Yep, that’s right, apparently the iPhone Dev Team have figured out how to boot a Linux kernel on the iPhone. Now dont get your hopes up, this build is very far from compleation. It currently has no wireless networking, no sound, no writeable support for the NAND flash memory and of course, no touch screen drivers yet so no way to interact with the OS.
Still this is an incrediable achevement as the dev team has had to reverse-engineer the iPhone’s boot loader so they could write their own, the result? a workingLinux 2.6 kernel on the Apple’s iPhone platform. they curently have this running on the first and second gen iPhones, lets keep a close eye on what the fokes on the iPhone dev team have coming up for us =)
I built a internal Mediawiki site for my company. A easy place to combine useful information. I recently came up with a backup script that I find rather useful and since I’m a nice guy I decided to share it, ok ok I have an alter motive I admit it! I’m a believer in open source, the more people editing the software the better it gets, so by all means, if you notice something about this script and you think “what an idiot he could have just done it this way and it would have been eaiser / more efficent. by all means let me know! =) thanks!
# CHANGE THESE OPTIONS TO MATCH YOUR SYSTEM !
wikiname=insight # wiki name (used for backup filenames)
wikidb="wikidb" # the database your wiki stores data in
wikidir=/var/www/ # the directory mediawiki is installed in
backupdir=~/bak # the directory to write the backup to
# END OF OPTIONS
# Put the wiki into Read-only mode
echo "Putting the wiki in Read-only mode..."
echo "$wgReadOnly = 'Dumping Database, Access will be restored in ~ 1 min.';" >> "$wikidir"/LocalSettings.php
echo "creating database dump, $db..."
mysqldump --default-character-set=latin1 --user=XXXX --password=XXXX "$wikidb" | gzip > "$db" || exit $?
echo "creating XML dump, $xml..."
php -d error_reporting=E_ERROR dumpBackup.php --full | gzip > "$xml" || exit $?
echo "creating file archive, $file..."
tar --exclude .svn -zcf "$file" . || exit $?
# Put the wiki back into read/write mode
echo "Bringing the wiki out of Read-only mode..."
head -n-1 "$wikidir"/LocalSettings.php > "$backupdir"/LocalSettings.bak
cat "$backupdir"/LocalSettings.bak > "$wikidir"/LocalSettings.php
# Creating TAR archive
echo "Creating TAR archive"
tar -cf $backupdir/$wikiname-$timestamp.tar $db $xml $file
rm $db $xml $file
If your anything like me you spend a lot of time at a bash terminal, weather I’m upgrading this very WordPress blog, or any other sites I run I usually do so over an SSH connection.
One thing I come to use quite often is my history. often times I don’t quite recall which switches I used to run a command I may have used yesterday. by typing “history” at the command line I get the past 1000 commands (500 by default on most systems) I ran. while thats a bit much lets say I wanted to recall where I saved the last tar archive I created. a simple “history | grep tar” will show all the lines that contain the word tar.
now for some useful options for how your systems history functions, I kicked my system up to record the last 1000 commands you can adjust this by making some changes to the environment in your personal bash configuration file (~/.bashrc) or in the global bash configuration file (/etc/bash.bashrc).
the first line will tell bash to ignore lines that match the last command you ran so if you run ps -awfux 3 times in a row (even if its over a couple hours) it will only record a single instance of that command.
the second line defines the size of the history file, in my case I chose to save the past 1000 lines.
so you have your fresh new Ubuntu system and you log in via ssh to be greeted with
“Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
bla bal bla”
so you fire up vim and change the good ol /etc/motd to sometime a little more along the lines of threating anyone who misuses the system with the wrath of IT.
super your new MOTD works great untill you reboot the system. heres a little secret about Ubuntu notice the first line of the MOTD when you logd in the first time? The line about the kernel version and other system information? Well thats all there because Ubuntu generates the /etc/MOTD file during system startup so any changes you make to this file will be lost on the next reboot. Solution? Ubuntu generates the first line then appends the conents of /etc/MOTD.tail to the end and saves it as /etc/MOTD.
so to use your new MOTD you need to save your message to /etc/MOTD.tail
A while ago I wrote a bit about Shared Key Authentication for SSH
, and discussed a bit about the benefits of enabling this on your own servers or even desktops. one of which is protecting your server against brute force attacks. However we never discussed that in order for your system to be truly protected from a brute force attack on your password you need to disable password authentication on your server. Please note before attempting this make sure that your keys work because if your configuring your server remotely and you disable password authentication you will lock yourself out
. Once you are sure that you can log into the remote host using your private key, we can safely disable the user name/password authentication.
The procedure to set this up is extremely simple. I’ll be showing you this on a Ubuntu Server install with OpenSSH but the procedure is similar on other setups. On a Ubuntu server the file will be located in /etc/ssh/sshd_config. your going to want to add the following to the config file (or change the values if they already exist.
Once you save the changes you’ll need to reload the SSH server with the following command.
Update 07/17/2012: Thanks to a reeder who pointed out something I missed, Ensure you’ve enabled public key authentication, I’ve noted that most often this is enabled by default but if its not YOU WILL lock yourself out. ensure the following is set in your configuration.
And then reload the SSH Service.
User@Host:~$ /etc/init.d/sshd reload
Thats it, your server should no longer accept user name/password authentication.