Friday, January 10, 2014

Sshkey install update.

Wrote a script a while back to put your ssh key on a remote system so you do not have to type in the password all the time. Found a few shortcomings with it and now have updated it. You will have to type in your password to login and complete the script process.

installkey.sh

# invoke with ./Installkey.sh servername

# set up the .ssh dir if it does not exist
DIRECTORY=",ssh"
ssh $1 'if [ ! -d "$DIRECTORY" ];  then  mkdir $DIRECTORY ;chmod 700 $DIRECTORY ; fi'

# copy the key
scp $DIRECTORY/id_dsa.pub $1:~/.

# install the key
ssh $1 'cat id_dsa.pub >> $DIRECTORY/authorized_keys'
ssh $1 'chmod 600 $DIRECTORY/authorized_keys '

# remove the public key you just copied
ssh $1 'rm ~/id_dsa.pub'

Thursday, January 9, 2014

Remote Arch linux install prep.

Installed arch linux on an i686 (aka pentium II). Installed linux many a time, but this is a new experience using arch as an os on a desktop. One thing that was different was to use the secure shell to remotely connect to the install machine. That way I could cut and paste commands as needed and save a lot of typing. There were some issues, that really were not issues. Had to use a search engine to rectify things I did not understand. Allegedly the live cd makes it easy to install. I had to do it the old fashion way. Having linux experience already made things easier. If I had been a novice, it would not have been installed.  Will probably take the several instruction sheets I used to make my own install procedure.  Kde seemed to work ok and the command line was very zippy.



I am assuming you know how to download and burn the arch linux cd.

 https://www.archlinux.org/download/

 http://mirrors.gigenet.com/archlinux/iso/2014.01.05/

Index of /archlinux/iso/2014.01.05

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory-
[DIR]arch/05-Jan-2014 03:26 -
[   ]archlinux-2014.01.05-dual.iso05-Jan-2014 03:41 528M
[   ]archlinux-2014.01.05-dual.iso.sig05-Jan-2014 03:41 287
[   ]archlinux-2014.01.05-dual.iso.torrent05-Jan-2014 03:41 30K
[   ]archlinux-bootstrap-2014.01.05-i686.tar.gz05-Jan-2014 03:42 75M
[   ]archlinux-bootstrap-2014.01.05-i686.tar.gz.sig05-Jan-2014 03:42 287
[   ]archlinux-bootstrap-2014.01.05-x86_64.tar.gz05-Jan-2014 03:44 77M
[   ]archlinux-bootstrap-2014.01.05-x86_64.tar.gz.sig05-Jan-2014 03:44 287
[TXT]md5sums.txt05-Jan-2014 03:44 220
[TXT]sha1sums.txt05-Jan-2014 03:44 244

Apache Server at mirrors.gigenet.com Port 80

Of course I had already installed arch linux on the pogoplug a while back.
Boot the arch minimal iso in the target machine.
At the root prompt change the password

# passwd
root@archiso ~ # passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

root@archiso ~ #

See if you have an internet connection

root@archiso ~ # ping -c 1 www.google.com
PING www.google.com (74.125.198.106) 56(84) bytes of data.
64 bytes from og-in-f106.1e100.net (74.125.198.106): icmp_seq=1 ttl=44 time=20.5 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 20.597/20.597/20.597/0.000 ms
root@archiso ~ #

See what the name of your nic card is to the system

root@archiso ~ # dmesg | grep eth
[   37.369974] systemd-udevd[178]: renamed network interface eth0 to enp0s12



Get the ip address of the nic.

# ip addr show dev enp0s12
2: enp0s12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 00 00 00 00 00 00 00 brd ff:ff:ff:ff:ff:ff
inet 192.168.8.127/24 brd 192.168.8.255 scope global enp0s12
valid_lft forever preferred_lft forever
inet6 fe80::210:5aff:fe19:fd88/64 scope link
valid_lft forever preferred_lft forever

Start the ssh session

# systemctl start sshd

Go to a remote machine and log in (since root is the only user, you have to log in as root with the password you just chose)

$ ssh root@192.168.8.127

The authenticity of host '192.168.8.127 (192.168.8.127)' can't be established.
ECDSA key fingerprint is (a bunch of hex numbers).
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.8.127' (ECDSA) to the list of known hosts.
root@192.168.8.127's password:
Last login: Fri Jan 10 03:27:12 2014 from remotecomputer
root@archiso ~ #

Now you can turn off the monitor to the machine to be installed to save a bit of power. From here you can follow any number of arch linux command line install pages:

https://wiki.archlinux.org/index.php/Beginners%27_Guide/Installation
Skip past the network install since it is already working.



Thursday, January 2, 2014

Silver bullet media casting.

Actually what I am talking about is the Google Chromecast. Chromecast allows you to throw the video or other media from the Nexus 7 to an hdmi enabled device such as a newer tv or monitor. So now you can attach a larger monitor to your nexus 7 via wifi and the Chromecast. Setup is fairly easy and you should be able to do it all via the Nexus 7 using the Chrome browser with internet access. You will also need the Chromecast app from the Playstore to be installed.  I now carry the Chromecast and a specially setup router with me. Make sure that is the router is only set up to take the mac addresses or special identification of the devices to connect to the router. Also use wpa2 or better wifi encryption. Not completely secure but not half bad.

Personally wish I had had it when I was teaching. For home media, I would probably prefer to use the Raspxbmc or the like.