The Coder’s 12 Commandments

Note: Source is missing

  1. Don’t create frameworks, YAGNI
  2. Use methodologies to support you, not to control you
  3. Read Code Complete and The Mythical Man Month
  4. Hire brilliant people
  5. Documentation is fiction, code is fact
  6. Can’t code => No decision power
  7. Testing rocks, debugging sucks. We are on good track on this
  8. Nine women can’t make a baby in one month
  9. Feed your developers good food
  10. Code reviews are important, we should to them
  11. Collect application data to decide about its performance
  12. Share knowledge, everything should be (internally) accessible to everyone

Some stuff that proofed to work while switching VPS to a new kernel for debian wheezy

First of all as root, create some users and give them sudo:
adduser sudo

from your local machine, use password-less ssh:

cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'

Mounting old file system per ssh in the new one:

sudo apt-get install sshfs
makedir /old
sshfs username@ipaddress:/remotepath /old

Apt Sources list:

cp /old/etc/apt/sources.list /etc/apt/sources.list
apt-get update
apt-get dist-upgrade

Why am I getting this on a new system?

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Add this to /etc/profile

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

And we also add a nice shortcut for recursive full text searches:

f(){ find . -type f -exec grep -nr $1 {} + ; }

Use like this: f searchterm

Install some packages (apt-get install):

rsyslog
torrentflux
phpmyadmin
dovecot-core
dovecot-mysql dovecot-antispam dovecot-sieve dovecot-pop3d dovecot-managesieved dovecot-imapd
clamsmtp
postfix postfix-mysql
spamassassin
graphicsmagick
graphicsmagick-imagemagick-compat
netcat

Shuffle some files around:

cp -r /old/var/www/* /var/www/
cp -r /var/cache/torrentflux/macolo/
cp -r /old/srv /srv

cp -r /old/usr/share/tead/ /usr/share/tead
cp -r /old/usr/share/yii/ /usr/share/yii
  • Move certs from /etc/ssl and /etc/ssl/private

Database:

mysqldump -u root -p --all-databases > /root/mysqldump.sql
mysql -u root -p < /old/root/mysqldump.sql

Dont forget to udate debian-sys-maintainer password from /etc/mysql/debian.cnf and rerun dpkg-reconfigure phpmyadmin

/etc/init.d/mysql restart

Replace some IPs in /etc/bind/

find . -name "*.db" -print | xargs sed -i 's/46.163.72.202/5.35.241.114/g'

Update some config files:

/etc/postfix/master.cf
/etc/postfix/main.cf
/etc/dovecot/conf.d/...
/etc/spamassassin/local.cf
/etc/clamsmtpd.conf
/etc/apache/sites-available
/etc/bind/...

Don’t forget to install the spam plugins:

apt-get install pyzor
apt-get install razor

iPad – Movies, Songs greyed out?

This did the trick for me:

1. Download and install iExplorer http://www.macroplant.com/iexplorer/

2. Plug in device first, then open iExplorer

3. Delete the iPhone\Media\iTunes_Control folder (you may want to copy this, just in case)

4. Restart the iPhone / iPad

5. Start iTunes. Not restore iPhone from back up, select New iPhone (don’t worry, you will not lost apps or data on your iPhone doing this)

6. Add music manually with iTunes

Source: https://discussions.apple.com/thread/3979901?start=30&tstart=0

Solution by: https://discussions.apple.com/people/Galileo634

Create a bootable Ubuntu USB stick on Mac OS X – so easy

This is really all there is:

1. Download an Ubunto .iso from ubuntu.org
2. Plug the USB stick into your mac os x system
3. open a terminal and type: diskutil list
4. unmount your usb stick: i.e. diskutil unmountDisk /dev/disk1
5. copy the content of the iso onto your usb stick: sudo dd if=~/Downloads/ubuntu.iso of=/dev/disk1 bs=1m
6. unload your usb stick: diskutil eject /dev/disk1
7. you’re ready!

Source and more: http://www.makeuseof.com/tag/how-to-create-an-ubuntu-installation-usb-on-the-mac/