Handy hacks

Reinstall video card drivers after botched ubuntu kernel upgrade

This one is for my brother as each time he does a kernel upgrade ubuntu forgets to upgrade his video card it has caused both of us alot of grief, nice thing is he can boot to an older kernel version and everything is fine.

sudo apt-get get remove nvidia-current && sudo apt-get install nvidia-current

Mondoarchive

Archive to local folder split into DVD size chunks very handy
mondoarchive -O -i -p `hostname`-`date +%Y-%m-%d-%s` -d /mnt/2T -s 4470m -N -E "/dev/sdb|/dev/sdc|/home/c0mputerking/mondoarchives|mnt/2T|/var/lib/vz/dump/|/var/lib/vz/template/iso" -9

Fixing Badblocks with linux

Using fsck to find badblocks on a disk with ext filesystem

Read only this answers yes to all questions, so it is sure to finish by itself.
e2fsck -c -C -y /dev/hda1

Non-destructive read/write method this answers yes to all questions, so it is sure to finish by itself.
e2fsck -c -c -C -y /dev/hda1

Using badblocks to find badblocks on a disk with no file system

Read-only
badblocks -b 4096 -p 4 -c 32768 -s /dev/hda1

Read-write
badblocks -b 4096 -p 4 -c 16384 -w -s /dev/hda1
The above settings use 128 megs of RAM

restarting rtorrent

# screen -fa -d -m rtorrent

For commands that run a long long time

You know the kind where you are afraid your putty session might die, window might reboot, Internet connection might break, mobile batteries might die, the city might have a black out, the world might end, or any other event that would leave you wondering did that command finish running. An example might be rsyncing a backuppc server with a couple of million files, and that uses backuppc with all those nasty cpool hardlinks can take days months years sometime never finishes no joke.

Option one and my personal favorite the script command learned this one way way back in FreeBSD 4.2 when rebuilding the world on my 486 100MHz with 16MB of RAM would literally take days. I was always impressed the hardware could stand up to this sort of abuse anyways here is the command verbatim from the good old FreeBSD manual.
script /var/tmp/mw.out

Then go about your business if thing get interrupted you can just tail -f the /var/tmp/mw.out file.

Option 2 the tee command not sure if this one even works if the terminal gets disconnected therefore might not be useful. However this one comes with a loaded rsync command we are talking all the popular options, am/fm radio, air, tilt, cruise, radial tires, and leather buckets. The tee bit is at the end of course but i have not tested how durable this command is so use at your own risk or test it and let me know in the comments.

rsync -avz --delete --one-file-system --exclude /var/lib/vz/root/203/srv/samba --exclude /var/lib/vz/root/202/var/lib/backppc --progress /var/lib/vz/ /mnt/data/ | tee /home/c0mputerking/$(date+"%F_%R")-data-rsync.log

Another rsync command timed and balanced not to overload the system
time ionice -c2 -n7 rsync -avHXz --delete --one-file-system --exclude /var/lib/vz/root/203/srv/samba --exclude /var/lib/vz/root/202/var/lib/backppc --exclude /var/lib/vz/solar/venus/pc/10.22.22.200 --progress /var/lib/vz/ /mnt/data/

THis is to hopefully stop linux from abusing my harddrives kudos go out to e100 over at the proxmox forums for suggesting this to me.

This is just a linux kernel config problem.
Swap aggressive:
Code:
echo 100 > /proc/sys/vm/swappiness
Avoid swap:
Code:
echo 0 > /proc/sys/vm/swappiness
The default value is 60

apache 2 ssl ubuntu 10.04
Submitted by c0mputerking on Sat, 07/28/2012 – 17:08
sudo a2enmod ssl
sudo a2ensite default-ssl
/etc/init.d/apache2 restart

2 comments

  1. Just desire to say your article is as astounding.

    The clearness for your put up is just great and that
    i could suppose you’re knowledgeable on this subject. Well along with your permission allow me to clutch your RSS feed to stay updated with approaching post. Thanks 1,000,000 and please keep up the gratifying work.

    1. No problem, thanks for commenting, and glad you found something in Computer King world useful, wish i had more time to document my skills however things move very fast here. Also it useally takes as much or more time to add infos to the site than it does to actually do the tasks, so alot of my work goes undocumented sad i know. Anyways thanks again for the friendly comment, and please feel free to ask any questions you might have about anything 🙂 I have had alot of help over the years, and am obligated to help others where, and when i can.

      Please let me know if the RSS works for you as this site is still quite new and not very tested

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.