chebe: (Default)
Problem: Linux uses up your 'extra' RAM for cache. But often refuses to free it when it's needed.

Solution: sync; echo 3 > /proc/sys/vm/drop_caches


*edit* (to set swappiness)
chebe: (Default)
I'm referring to this entry:

The information presented therein is incomplete at best, inaccurate and unhelpful at worst. Here's the update.

Log in to your desktop (graphically, over vnc, etc) and nothing gnome related is loading properly. You see errors like:
"Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See for information. (Details - 1: IOR file '/tmp/gconfd-oracle/lock/ior' not opened successfully, no gconfd located: No such file or directory 2: IOR file '/tmp/gconfd-oracle/lock/ior' not opened successfully, no gconfd located: No such file or directory)"

You try gconftool-2 --spawn or similar, and receive the same error.

You look for those files, and they don't exist.

You edit /etc/syslog.conf to include user.* /var/log/user. You restart the syslog daemon /etc/init.d/syslog restart or service syslog restart. Reproduce the error, and open the log at /var/log/user, where you find:
"Mar 15 10:40:51 mycomputer gconfd (root-6666): Bad permissions 711 on directory /tmp/gconfd-root"

ls -ahl /tmp and look for any gconfd-{user} files. These permissions need to be private. That would look like:
drwx------ 3 root root 4.0K Mar 15 10:53 gconfd-root
in case you were wondering.

To fix, chmod 700 /tmp/gconfd-{user}

Annoyingly this seems to be a side-effect of installing a certain product in work. It happens every time. But now that I know how to fix it, it's all good.
chebe: (Default)
Problem: Grub replaced MBR without asking.

I'm a dual-booter. I keep the XP installation that my laptop came with because some proprietary software, especially the newest stuff, only really works on Windows. I also have a partition for work purposes, with crazy-strict security. And then, then I like to install different flavours to play around with. So happened one day I was playing with Ubuntu. Then it did something that I disliked very much, it replaced my Windows MBR with grub. But not just any grub, one with config files bloated with comments and talk of auto-updating. I quickly decided that Ubuntu (at least that release) wasn't for me*, but I couldn't delete for fear of what it would do to my booting ability. Fast forward a few months and I've managed to get the grub menu to be chain-loaded from the default Windows MBR. (I did it mostly ass-about-backwards, but these are the important steps.)

1. Burn yourself a linux rescue cd, just in case. Personally I like SystemRescueCd (also, wget for Windows? *glee*). Backing up all the files in question is a good idea as well.

2. Boot into your Linux that maintains the active grub menu. Copy the boot sector to a file (name unimportant).
dd if=/dev/sda4 of=/mnt/external/bootfile.lnx bs=512 count=1

3. Boot into Windows XP, copy the bootfile.lnx somewhere, and edit your boot.ini. It's probably hidden, so from cmd.exe:
cd C:\
edit boot.ini

Append to end of file (under operating systems) something like:
C:\bootfile.lnx="Linux Grub"
Save and exit.

4. Insert a Windows Installation disc, or Windows rescue disc. Reboot into cd. Go to the Recovery Console (R), select which Windows partition (generally 1), enter password (may be null, in which case just press return), and at prompt enter:
Accept warning. When complete, reboot.

5. Try out your new menu.

I am almost back to where I was. One of my Linux partitions is still buried inside the grub menu. I was unable to create a working bootfile for it to give it it's own MBR entry, but I haven't given up. Also, I did most of this in reverse order, and used the linux rescue cd to reinstall/re-setup grub on the Ubuntu partition. I don't think that was necessary, but I was/am just figuring things out. Maybe that's what allowed me to create the working bootfile? I don't know yet, but I'll keep looking.

*(I don't intend to do any kind of flavour bashing here, this is just personal opinion. If you disagree, good, variety is, as they say, the spice of life :)
chebe: (Default)
Problem: PC system beep. Need I say more?


- Immediate switch off: /sbin/rmmod -v pcspkr

- Stop it from loading back up: vim /etc/modprobe.d/blacklist
And append: blacklist pcspkr
chebe: (Default)
The Windows XP edition:

Trying to do things through the command prompt, and without installing third-party tools, not always so easy. (Warning: contains some artifacts from use in batch scripts, e.g. variables:%BUILDSHARE% and running in new windows:start "" /w)

1. Uninstalling a program.
- Run regedit
- Navigate to the program, something like:
HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Uninstall

- Make a note of the hex key, e.g. {4321ABCD-AB34-12CD-EF56-98769876DCBA}
- Then from cmd.exe:
msiexec /X {4321ABCD-AB34-12CD-EF56-98769876DCBA} /qn

Code stays same for product through different versions. Only really useful if you're continually un/re-installing the same product.

a. Mount a remote server.
- start "" /w NET USE W: %BUILDSHARE%
b. Unmount a remote server.
*edit* NET USE does not play well with the Server service in Windows (particularly Server 2003). You have to stop the Server service to use it. Which, defeats the purpose of having a Server install at all.

3. Unzipping a non-NTFS-specific compressed folder (i.e. .zip)
- There is a way through the GUI, so far only got to opening .zip from command prompt, then use Extract All button. Opening a .zip from cmd.exe: RunDll32.exe zipfldr.dll,RouteTheCall
- Or accept it's not happening. Buy WinZip, or install 7Zip or IZArc (my personal fave) command line utilities. IZArc: start "" /w IZArc -eh %SAVELOC% %ARCHIVE%
chebe: (Default)
On RHEL Server 5.3, if you wish to permit access from other machines on your network through a new port (one not commonly used) you add it as usual through iptables:
/sbin/iptables -A INPUT -s -d -p tcp --dport 66666 -j ACCEPT

To save the new rule to keep it past reset:
/sbin/iptables save
/etc/init.d/iptables save

But, the new port will not take effect unless it is also added through the GUI. From the Desktop menu go to:
System > Administration > Security Level and Firewall

On the Firewall Options tab, expand Other ports, and Add your port and protocol. Apply, and OK out. Now the port should be opened immediately.

On SLES 10.0, SP1, there is no iptables. Instead there is SuSEfirewall2. To open a port open the config file: /etc/sysconfig/SuSEfirewall2, find the line with FW_SERVICES_EXT_TCP="" (in vim normal mode type /what you're looking for, n to move through the list, N to go backwards) and add your port number to the space separated list. Exit and save. Reload rules with command: SuSEfirewall2

Things I Needed To Know

2009-Dec-19, Saturday 01:56 pm
chebe: (Default)
Problem: USB flash drive is mounting as read-only, making it useless.

0. get root permissions, su root, or run everything through sudo
1. umount the drive
2. df -h to find your drive
3. fsck -a /dev/sdb
4. mount -t vfat /dev/sdb /home/user/folder

Be happy, you can write again!
chebe: (Default)
In vim the command :TOhtml creates a syntax highlighted html version of your file. Open the html, and copy paste into OpenOffice, and you have lovely syntax highlighted code that is much easier to read.

Things I Needed to Know

2009-Dec-12, Saturday 12:44 pm
chebe: (Default)
To make an executable jar (laugh if you want, but I was always happy without an executable):

- need to be in bin folder (or the root of your .class structure)
- create, add:
Main-class: socket/client/main
- jar -cvfm socketclient.jar socket/client
- chomd 777 socketclient.jar
- ./socketclient.jar (or java -jar socketclient.jar
chebe: (South Park)
2GB of RAM just is not enough for a multi-layered server. Ever.

Okay, not a real 'thing I didn't know', but it's still annoyingly true.
Page generated 2017-Oct-18, Wednesday 07:09 am
Powered by Dreamwidth Studios