Enable Ubuntu 8.10 Root Password
By Jason on Jan 14, 2009 | In Linux | Send feedback »
One of my main frustrations with Ubuntu has always been the lack of a usable root account.
As a result, I've taken to enabling the account on all of my boxes.
All you have to do is assign a password to the account:
Code:
sudo passwd root |
and if you decide to disable the account later:
Code:
sudo passwd -l root |
If you do add a password to root, don't mess with the sudoers file, as if you disable root in the sudoers file and later disable the account itself, you won't be able to do anything and will have to use a livecd to fix it.
ORA-27121: unable to determine size of shared memory segment
By Jason on Jan 14, 2009 | In Linux | Send feedback »
Installing Oracle 10G on Ubuntu this morning...
Got the following error:
Code:
ERROR: | |
| |
ORA-01034: ORACLE not available | |
| |
ORA-27121: unable to determine size of shared memory segment | |
| |
Linux Error: 13: Permission denied |
This is caused by Oracle installer not setting setuid on $ORACLE_HOME/bin/oracle. To fix do:
Code:
$ cd $ORACLE_HOME/bin | |
$ chmod 6751 oracle |
Flush DNS Cache on OSX Leopard
By Jason on Jan 14, 2009 | In Linux | Send feedback »
The method for flushing the DNS cache on OSX has changed with Leopard.
Here is the right way:
Code:
dscacheutil -flushcache |
the old method (lookupd) has been deprecated.
Add Swap to Linux...
By Jason on Jan 13, 2009 | In Linux | Send feedback »
This is an old sysadmin trick, but a good one all the same.
Suppose that you finished installing a brand-new Debian GNU/Linux server, and for whatever reason you forgot to set aside some space for a swap partition. Or you correctly got some swap space at installation time but now you desperately need some more. Well, despair not. It’s a little known fact that you can have swap space in a file on top of the filesystem instead of using a dedicated block device.
This simple recipe will give you 2Gb of swap space. Here we go:
Code:
# mkdir /var/swap | |
# chown root.root /var/swap | |
# chmod 700 /var/swap | |
# dd if=/dev/zero of=/var/swap/01.swp bs=1024 count=2M | |
# chown root.root /var/swap/01.swp | |
# chmod 600 /var/swap | |
# mkswap /var/swap/01.swp |
Now add this newly created swap space to your /etc/fstab:
Code:
/var/swap/01.swp none swap sw 0 0 |
Theoretically, you won’t get the same performance as using a dedicated block device, and if the file actually gets fragmented it might drop rigt to the floor, so if you try this at all do it as soon as possible after installation. So if what you’re trying to do is to *increase* your available swap space instead, you may add a priority option to give preference to the block-device swap space:
Code:
/dev/hda1 none swap sw,pri=1 0 0 | |
/var/swap/01.swp none swap sw,pri=2 0 0 |
And just this time activate the swapspace with addswap (The initscripts will do it on every boot thereafter):
Code:
# swapon -av |
That’s all there is to it.
IE7 and PHP $_SESSION Vars...
By Jason on Jan 10, 2009 | In PHP | Send feedback »
OK, most people have heard of the dreaded IE7/PHP $_SESSION[''] nightmares... and there are about a million different solutions out there.
Here is the bit of code that worked for me:
Code:
<? | |
header('P3P: CP="CAO PSA OUR"'); | |
session_start(); | |
... | |
... | |
?> |
It turns out that you have to add a special header before opening the session.