Wednesday, May 15, 2013

Hack Buffalo Pro Duo to use rsync and SSH

Hello world! Recently someone I was doing some work with needed a solution for backups. They wanted to use a external HDD system where one HDD would be active and get nightly backups for a week then they would rotate it out. They got four Buffalo LS Pro Duo 4TB which are great devices. Problem is they have OpenSSH and rsync installed... but they aren't usable. This is no good. I want to have a cron job on the servers simply compress everything, then rsync it to a directory on the Buffalo. So it's hacking time!

First thing you'll need is your buffalo attached to a network. If your like me and happily lack a windows computer you won't be able to use the CD it came with to find it on your network. Just use Fing on your smart phone and scan your network or use your handy dandy MikroTik to scan it. The DNS entry it comes with by default is the model number. Mine showed up on Fing as "LS-WVLC86" and of course had Buffalo next to it. Now you have the IP, mine is 192.168.0.104. At this point you can jump on the webGUI and change it but I want to get SSH and rsync up and running first.

Now assuming you already have java on your computer you'll need to DOWNLOAD ACPCOMMANDER . ACP commander allows you to send a single line command to the Buffalo. Now there's a bunch of guides out there that have a bunch of crazy steps with PHP and sillyness, ignore that crap. All you need to do it do the following:

Change root password:

java -jar acp_commander.jar -t 192.168.0.104 -ip 192.168.0.104 -pw adminpasswordhere -c "(echo newrootpass;echo newrootpass)|passwd"

Allow root to login on ssh:


 java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw adminpasswordhere -c "sed -i 's/UsePAM yes/UsePAM no/g' /etc/sshd_config"

java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw adminpasswordhere -c "sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/sshd_config"

Restart ssh service:


java -jar acp_commander.jar -t 192.168.0.10 -ip 192.168.0.10 -pw adminpasswordhere -c "/etc/init.d/sshd.sh restart"

(Shout out to Matt Wells for forcing me to learn sed and awk)

Well that's really it,  open a terminal and ssh away! Also note that this is persistent through reboots. 

Now set up public/private key authentication. ( Guide ) Once you have that done just up a .ssh/config file and you can back everything up.

Saturday, April 20, 2013

Random guy's HTC One review



I've been pretty excited for the new HTC One, and today I finally got it. Keep in mind I'm coming from a two year old iPhone 4. I won't fill this with the serious specs, you can see those here, this is just my thoughts on it. Honestly it's fucking incredible. This is unorganized because I did it through out the day.

Body and Design:

The first thing I noticed is how big it is. Compared to the iPhone 4 this things a monster. Because of the size difference my keyboard skills and how I hold it is having to change to the different size. Overall though I love it. It's a very pretty phone and it feels professional. The display is a huge improvement over the retina display and colors are more crisp and the blacks are deep. The volume buttons are pretty big though and I've changed the volume quite a few times changing my grip. One of the biggest things I noticed right off the bat though is it gets hot. Really hot. It 's only during heavy use though. I was pulling stuff back and forth over FTP with AndFTP, downloading and updating apps, and of course playing a 3D game. This is the only real thing I'm concerned about, especially living in Las Vegas. The summer gets hot and I'm afraid it will over heat... but we'll see. Lastly, I miss my vibrate setting switch.

Sound:

The sound quality is another nice improvement. The headphones that came with it though are trash but the sounds through a normal headset are more distinct. I now understand "dropping the bass".... The sound is alot like the display, my old phone was good, but this just makes the little details alot clearer which gives a overall better experience. The duel speakers on the front are alot louder than I'm used to and mixed with the big screen, I can see watching something with someone else would be comfortable.

Battery and Hardware:

The phone is very smooth, even with alot of apps chewing up RAM I never felt that it was lagging. Everything was really fluid and fast, coming from the iPhone it's another very noticeable improvement. Switching between previous apps and stuff works the same by double pressing the home button. This is where it's really noticeable, I can jump between games and apps instantly regardless of what they are.

The battery is somthing I'm still looking at so this isn't final but right now I'm leaning toward it sucking. I let it die on it's own yesterday then started charging it. I used it all day and charged it all day and never passed 15%. It was running through the battery faster than I could charge it. Today though I have a full fresh battery, so we'll see...

HTC Sense, Camera and everything else:

I of course loaded ROM manager and grabbed a clean jellybean. Overall there wasn't much of a notable difference. So I switched back to HTC Sense to check out Zoe and Blinkfeed. Zoe is really cool, slow motion captures and all that good stuff is fun. I was surprised at how much I liked seeing my gallery come alive, I felt like Harry Potter. Blinkfeed is cool I guess, I don't see myself using it much and it's kind of annoying it's the default page, I'll play with it more and maybe like it though... The Camera takes good pictures. That's all I can say about it as I am not a photographer or know anything about it, it takes pictures, it's golden for me. The coolest thing though it the TV remote. It's awesome and I spent alot of time just playing with that. My phone is now my default remote and it works great with my old ass POS TV.

Anyways, these are just my initial thoughts, I'll update this more when I've had more time with it.

On a side note, I have an AT&T unlimited data plan, and their 4G is faster than my Wifi so I just stay on it, and I am chipper.

Tuesday, April 16, 2013

Setup your own VNC reflector!

   So if your like me when someone calls complaining about their computer, you first listen to what they're saying (chances are you might not get much from it), then ask to see the issue. There's a couple of ways this can be done. The first way is physically going to look at the machine or problem, but honestly, ain't no one got time for that. Then there is the "free" remote services, like Team Viewer, Logmein, and if you're desperate, you setup a adobe connect trail account and go from there. However if your doing this for money, you should be paying those companies so as not to steal their product. So how then can you access computers outside your network? Easy, you setup a VNC reflector then use TightVNC . TightVNC is really handy and, free. The concept is you install TightVNC on all computers you control for a customer, or have them install it on the machine your helping with. Now if you have a domain this is easier but I'm going to go through it as if you don't.  When they call with an issue, you just have them "attach" to your reflector, then you view it. It's a nice secure way to remote control machines, and multiple people can view it. So if your training someone they can view the same machine your working on.

First off though, you need a "server" to host the reflector. I'm using a machine with Ubuntu 12.10 but any Linux distro well do it. Then you'll need to get the following onto that machine. If your a novice you can download it directly or just download it then scp/rsync it over.  I did the following as root because I'm lazy so you hard chargers might need to add sudo in front of the commands.

http://www.wisdomsoftware.gr/download/uvncrep015-ws.tar.gz

If your using a Debian based machine run the following to get the dependencies:

apt-get install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc 

For Redhat ( Centos, Redhat, Fedora) use:

yum install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc 
Now move the package you downloaded to /usr/local/src

mv uvncrep015-ws.tar.gz /usr/local/src 

Unpack it:

gunzip uvncrep015-ws.tar.gz 
tar -xvf uvncrep015-ws.tar.gz 


Install it:

cd uvncrep015-ws 
make; make install; 


It will need a user to run ass so make one:

useradd uvncrep 

The ini file is /etc/uvnc/uvncrepeater.ini . feel free to play around with some of the settings but here's a few important ones to look for:

viewerport = 5901 
maxsessions = 10 
runasuser = uvncrep 
logginglevel = 1 
srvListAllow1 = 192.168.0.0 ;Allow network 192.168.x.x 
srvListDeny0 = 127.0.0.1 ;Deny loopback 


Start it up the service:

service uvncrepeater start 

That's it really, to test it install TightVNC on a computer and then "attach listening viewer" depending on how many sessions you specified in the ini you can have alot of channels. Type the hostname or IP of the reflector then the port, ex. 192.168.0.10:5901 . The TightVNC icon will turn black. Then on another machine just use the VNC viewer and connect to 192.168.0.10:1 and away you go! For external use you'll have to do some port forwarding. More information on that can be found at http://www.uvnc.com/docs/uvnc-repeater.html

Also a fellow by the name of Neil Whelchel has a really sweet repeater, but he hasn't written any docs or released it. Maybe someday though.....

Thursday, April 11, 2013

SSH to new machine and news!

SOOOOO I haven't posted in forever. That however is going to change. I'm currently working on my company (CF Solutions, LLC) and going to CSN finally to get my degree in Computer Engineering. I have my G.I. Bill but it still makes sense to go to CSN, on the cheap, to get all the gen ed stuff out of the way then go to UNLV to finish my major. As a result though, currently I have time on my hands, and need some income... hence the ads. So do me a favor and follow this blog for daily *nix stuff and check out some of the stuff thrown at you on all my pages!

Anyway this is a really noobish thing but something I always find myself forgetting momentarily  After you finish installing a fresh copy of some distros openssh-server isn't installed by default. So if yout get this:

# ssh cflinspach@192.168.0.104 ssh: connect to host 192.168.0.104 port 22: Connection refused

Just jump on the new machine and do:

# apt-get -y install openssh-server

Anyways, more to come!

Thursday, November 15, 2012

AirMech in chrome!



    So as many of you know, I dig video games. Unfortunately I cannot slay dragons in the real world. Linux lacks alot of good games, (which is changing with steam on linux LINKZ). However here's a pretty epic little up and coming game that you can install on chrome. They are looking to port it over to some linux distros but currently this is the best we can do without dealing with Wine.

   Airmech is a gooood game. I grabbed it off steam when I was bored about a week ago and my work productivity has indeed suffered ( I work from home). Its a RPG RTS hybrid that has alot of possibilities. You can use your google account so even if you get it off steam in windoze then you'll be fine when you use it in chrome, using the same account that is. In chrome there seems to be some issues with the spacebar working correctly that doesn't exist with their steam version but it's still playable. Personally I use the Osprey because I like to spit out units and that jazz. The osprey in this game is even like the one in real life, you know, always crashing.... Anyways if you feel like playing with me, add me as a friend, my username is GrimKingIX.

Tuesday, November 13, 2012

ssh to everything like a baws

   First off sorry for the disappearance, I've been busy with work. Then of course I decided I would go on a run for the first time in what seems like forever. I was very disappointed  when I was in the Marine Corps I was in good shape. Not any more... so immediately I had a knee jerk reaction to push myself to run an Iron Man race in 2014, you know because it's the rational thing! Now I'm always tired.

    Any who, now for work I am starting to get more places that I need to ssh to. Before it wasn't much of an issue and still probably isn't but since it's not broken why not fix it! In all reality having your client ssh config file up to date is something you should be doing, it saves time and you'll  have less things to remember. The config file goes in your .ssh directory. Below is an example of a config file:


host kuva
HostName kuva.firstlight.net
IdentityFile /home/cflinspach/.ssh/privkey

host other
HostName xxx.xxx.xxx.xxx
IdentityFile /home/cflinspach/.ssh/privkeyother
port 84565
User itsme

StrictHostKeyChecking no

I'm not going to go into everything you can do with this file, just what I think might be a useful foundation. For more stuff you can go to the man page. Lets break it down.

host - host is not only what you will type when you ssh but it "Restricts the following declarations (up to the next Host keyword) to be only for those hosts that match one of the patterns given after the keyword.  If more than one pattern is provided, they should be separated by whitespace." -Man page

So when I type ssh kuva it really does ssh -i  /home/cflinspach/.ssh/privkey kuva.firstlight.net because under host my declarations say that kuva is really kuva.firstlight.net. Also I identified the path to the private key I used for authentication. In the second example this is handy for servers without DNS entries. Instead of an ip I just type ssh other and it does ssh -i /home/cflinspach/.ssh/privkeyother itsme@192.168.0.0 -p 1022 .

So you can see this is pretty helpful if you have alot of systems you have to ssh to.

Sunday, August 5, 2012

Windows 8 "Catastrophe"! YAY!

Morning everyone! It's been awhile since my last post. I travel alot for work and last week I spent the week in Tampa working on a new gaming boat. ( For you gamblers it's call the Trade Winds and its looking pretty good!) I came home and didn't have time to play around in my lab as I'm currently getting ready to move into my new house, then two days later I got shipped off to Colorado. I wanna give you geeks and geekettes something though so on to GAMING NEWS!

One of my only issues with the Linux world is the lack of video games. I currently duel boot on all my systems with windoze to ensure my thirst for slaying dragons stays quenched. Yes Wine and Play on Linux work great, until something patches... Or you were just minding your own business playing Diablo 3 when Blizzard decided to ban some of the linux players ( I didn't know if they were cheating or whatnot but still.) However great news everyone! The head of Valve Gabe Newell said Windows 8 will be "a catastrophe for everyone in the PC space," according to VentureBeat. I got the quote from PCMag . And since Windows 8 is going to suck so incredibly hard, Valve is bringing Steam to Linux! No word on what distros or any of that but once it hits one it will pop up in the rest shortly there after. Right now there's Bastion, which you can get from the Ubuntu Software Center for $18.99 ($2.99 on steam wtf?) and is epic all around. But I need more! Guild Wars 2 or something huge that I can play without all the windoze overhead. 

Also on a final note,