in8snotesThis portion of my site is powered by Blosxom. Blosxom is a perl script whose functionality here is extended through several plugin scripts in order to dynamically assemble a multitude of separate plain text files stored in a directory tree on the server into a cohesive, dated and RSS enabled weblog. Now in daily (r)sync with the directories on Nate's Powerbook.
blosxom |
Return to in8sworld.net Over an ssh connection, you can use the following shell command to list the processes of a user in order so that the lowest number is at the bottom (so you see it when the script finishes). This is probably the x-session manager or initial bash login. Kill that process to kill the user session. ps aux | grep username | awk '{print $2 " " $11}' | sort -gr
Last saved: 02/23/2008
Getting OSX to connect up to a samba share on Ubuntu
this was just what I needed to get it to work.
mksmbpasswd /bin/cat /etc/passwd | /usr/sbin/mksmbpasswd > /etc/samba/smbpasswd
smbpasswd -e username Users can run smbpasswd themselves to update their passwords from here on.
Last saved: 01/25/2008
Killing all vncserver sessions
Watch the placing of the colon after kill. It should be vncserver -kill :1
The :1 is togethor. There is a space between kill and :1 so it Hope this helps.
Last saved: 12/18/2007
I originally had a post in Geeklog which was indexed in search engines here and there and linked off friend's sites. Instead of getting them to change the link, I used a Redirect rule in my .htaccess file to point to the right place.
The original Geeklog url had a query string (the question mark and equals sign part)
When I moved the site to Wordpress, the same page now lives here:
I added these two lines to my .htaccess (on Dreamhost this has to reside in the 'domain directory'): The first line says to look for a condition where
rewriteCond %{query_string} story=20040426185512453
Last saved: 06/09/2007
#:1497621 6:14 pm on May 12, 2005 (utc 0) This stuff is rather complex. It involves converting the octets (the groups of numbers delimited by the periods) of the address or address range to binary, and then generating a "mask" that is used during comparison of the incoming address and the specified allow/deny directives. A basic example would be that you want to deny 192.168.192.0 through 192.168.255.255 In binary (use the Windows calculator or equivalent) that is 11000000.10101000.11000000.00000000 through 11000000.10101000.11111111.11111111 Having derived that, you now need to generate either a netmask or a CIDR. The easiest way to do it is to line up the start/end addresses vertically, and then examine them to see which bits change between the first and last address of the range. Then mark those that don't change with ones and those that do with zeroes:
11000000.10101000.11000000.00000000 This yields the netmask, which when converted back to decimal octets is 255.255.192.0 To get a CIDR, you count the number of ones from the left, in this case 18. So, you would use
Deny from 192.168.192.0/255.255.192.0 (Network/netmask pair -or- Note that when the netmask contains trailing octets containing all zeroes, you can simply leave them off and use a simple partial IP address. An example would be 172.0.0.0 through 172.0.0.255, which could be specified as a partial IP address as: Deny from 172.0.0. For more information, do a search for "netmask" and "CIDR." There are also several online netmask and CIDR generators avaialble. In addition, if you look up your problem IP addresses in ARIN, the CIDR value is often given in the data record containing that IP address. Unfortunately, this is as simple as it gets. Jim
Last saved: 05/20/2007
htaccess file for in8sworld to screw spammers
RewriteEngine on
SetEnvIfNoCase Referer 209.8.22.250 spammer=yes
deny from 64.71.131.110 allow from all ErrorDocument 404 /blog/index.php?error=404
RedirectMatch temp ^/$ http://www.in8sworld.net/blog
Last saved: 01/07/2007
RewriteEngine on allow from all ErrorDocument 404 /blog/index.php?error=404
deny from 64.71.131.110 RedirectMatch temp ^/$ http://www.in8sworld.net/blog
Last saved: 12/31/2006
VIM replace all extraneous ^M:
:%s/^M$//g BE SURE YOU MAKE the ^M USING "CTRL-V CTRL-M" NOT BY TYPING "CARROT M"! This expression will replace all the ^M's that have carriage returns after them with nothing. (The dollar ties the search to the end of a line)
Last saved: 12/21/2006
Command line mysql backup and restore
# make a backup (http://dev.mysql.com/doc/mysql/en/mysqldump.html) shell> mysqldump -h HOST -u USER -p --opt DATABASE TABLE > search.sql
# import a backup (http://dev.mysql.com/doc/mysql/en/mysql.html) shell> mysql -h HOST -u USER -p DATABASE < search.sql
Last saved: 12/19/2006
I was always told that if you had a dual boot system, Windows had to be on the first partition, but I wanted the first partition to be linux, and you can do it by using a fake-out line in the boot loader. This is an example using lilo from 1999, I would figure out how to do it using grub if I did it these days. It's the 'map-drive' lines that does the work of faking out the drive so windows doesn't realize it's not on the first partition. The new lilo.conf file reads:
boot=/dev/hda
image=/boot/vmlinuz-2.2.12-20
other=/dev/hdc1
Last saved: 12/27/2005
Capture a streaming Real Audio to a wav file
mplayer -playlist file.ram -ao pcm -aofile file.wav -vc dummy -vo null
Last saved: 11/05/2005
php configure on OZ (before messing with it)
Trying to upgrade php and include the Oracle -oci8 (Oracle interface) module using Oracle's 'instant client' libraries (previously installed). LD_LIBRARY_PATH already set. './configure' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-discard-path' '--disable-force-cgi-redirect' '--enable-shared' '--disable-static' '--disable-debug' '--disable-rpath' '--enable-pic' '--enable-inline-optimization' '--enable-memory-limit' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php' '--with-pear=/usr/share/pear' '--enable-magic-quotes' '--enable-debugger' '--enable-track-vars' '--with-exec-dir=/usr/bin' '--with-versioning' '--with-mod_charset' '--with-regex=php' '--enable-track-vars' '--enable-trans-sid' '--enable-safe-mode' '--enable-ctype' '--enable-ftp' '--with-gettext=/usr' '--enable-posix' '--enable-session' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--with-openssl=/usr' '--without-kerberos' '--with-ttf' '--with-freetype-dir=/usr' '--with-zlib=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-oci8-instant-client' Unfortunately, that built a CGI executable alright, but it didn't build a module since I was missing the --with-apxs2=/usr/local/apache/bin/apxs line. (The configure line I used on the pbook 'just worked'): './configure' '--with-zlib-dir=/usr/local' '--with-libjpeg=/sw' '--with-libtiff=/sw' '--with-gd' '--with-mysql=/usr/local/mysql' '--with-apxs' Oops. apxs comes in the apache2-devel package (not installed). However, after grabbing and installing that, and making a symlink over to apxs2 (from apxs), I still had no joy. The configure fails, I'm giving up for now.
Last saved: 10/10/2005
What I'll need to upgrade to get php 4.3.11 on OZ
apache2-mod_perl-2.0.47_1.99_09-3mdk.i586 (due to unsatisfied apache2 == 2.0.47)
Last saved: 10/08/2005
Posted by jmdault on Monday, March 24 2003 @ 06:46 Good news is you don't have to recompile the whole PHP just to add oracle support. You just need php-devel and the Oracle Client Interface.
Click the Full Story link for a preliminary HOWTO.
Second, you must download and install Oracle, by following You need to download the 1st and second files. They are compressed cpio archives, and you need to unpack them.
Important Note: Some browsers will uncompress the files but Then, you can install Oracle.
cd /home/oracle/Disk1/install/linux Please note you'll need at least 512 megs of RAM, and the same amount in swap. Oracle is a beast ;-) Install Oracle in /usr/oracle/9.2, and make sure you select Oracle Client Interface, this package contains the header files you will need to compile php-oracle. When install is done, make sure you have a suitable development environment (autoconf, automake, gcc, php-devel, rpm-build), and cd to /usr/src/RPM/SPECS Download the php-oracle spec file into this directory. Before compiling, you will need to define some environment variables. The minimum required is: export ORACLE_HOME=/usr/oracle/9.2 Then, compile the module by doing: rpm -ba php-oracle.spec If everything went right, you can install the php extension:
cd /usr/src/RPM/RPMS/i586 (you need --nodeps because some oracle libs are not in the rpm database). You can now try "php -m" to see if the module is installed, or use a script with phpinfo(). To complete your setup, you need the environment variable to be loaded at boot:
cd /etc/profile.d Then, restart your web server:
service httpd stop You should be all set! If not, I'm available for consulting to help you setup everything. I charge very reasonable rates. Also, if this howto was useful to you, or you would like to see more Oracle support, please consider contributing to the Mandrake Corporate club (contact me on this). My goal is to certify Mandrake with Oracle, but this is very expensive, and my employers try to keep costs down. But if enough people are willing to contribute money, we can easily raise enough to afford the certification tests. Jean-Michel
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. (C) 2003 by Mandrakesoft B
Last saved: 10/08/2005
(requires mod_rewrite enabled in httpd.conf) which points requests for my in8sworld.net/notes to the cgi script that runs the site. This removes the cgi path from the visible URL, which is cleaner than my http refresh I was using. I do have to fix all my URLs now to point to the new place.
RewriteEngine on
Last saved: 08/13/2005
OpenSkills: GPG User ID maintenance
This info is taken from here The information on this page is intended to help if you want to add a new email address to your key, or remove an old email address. Note: this is now a very easy thing to do if you are using one of the GUI based OpenPGP tools. GPG keys may have a number of user identity (uid) records bound to them. Here we discuss the creation and management of uids.
Introduction + The First UIDThere are two kinds of uids. Text uids and photographic uids. Here we will only consider the regular text uids.
As part of the process of making a key (using A uid is bound to a key by a "self-signature". The very key the uid is to be bound to is used to make a signature for the uid. This signature is held against the uid, and indicates (for example to key management software) that the uid is bound to the key.
At the completion of the --gen-key process we have a new key and a single uid bound to the key by a signature. You can see get a view of this using In this partial output we see the key (on the line starting with "pub") and the uid (on the line starting with "sig"). "pub" is short for public key. "sig" is short for signature. Looking at the sig line in detail: The number 3 following "sig" indicates that this key was signed with a confidence level of 3, the highest level (See Signing OpenPGP Keys). Following the 3 is the key id of the key which produced the signature, and as this is a self-signature, the key id is that of the current key (on the pub line). Next we have the date the signature was made. Finally, we have the real name / comment / email address information. Note that the information for our single uid appears twice. Once associated with the key (the "pub" line), and once associated with the uid (the "sig" line). The "primary uid" is always listed with the key. In this case, the one and only uid is the primary uid. There must always be one and only one primary uid bound to a key.
Adding a new uid
A new uid is added to a key using the
Note that the commands entered by the user are in red.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||