Ubuntu 11.10 post install guide
by nate on Dec.04, 2011, under Uncategorized
Here are some things I do to Ubuntu after the base install.
Missing core functionality
1) acrobat pdf viewer (xpdf is great and all, but yeah I like the real deal better).
This downloads a compressed bin, you have to chmod +x it to get it to run:
$ sudo chmod +x AdbeRdr9.4.6-1_i486linux_enu.bin
$ sudo ./AdbeRdr9.4.6-1_i486linux_enu.bin
Once installed you should get this in firefox about:plugins as well as the ability to view pdfs inside firefox:
Adobe Reader 9.4
File: nppdf.so
Version:
The Adobe Reader plugin is used to enable viewing of PDF and FDF files from within the browser.
2) encrypted chat with pidgin and pidgin-otr
$sudo apt-get install pidgin pidgin-otr
Optional
1) chrome
http://www.google.com/chrome
2.6.38 Kernel x86_64 SL Centos RPMs
by nate on Apr.24, 2011, under Open Source Linux
For use with high performance storage systems….
I built these rpms with some help, check out the twiki page:
yahoo mail fail
by nate on Dec.27, 2010, under Uncategorized
this is why I dont use yahoo and why gmail is much better.
New Chat message from ashley_kinky_cam9wbrpfgvixzncji
(Received 12/27/10 4:31 PM)
This message is from unknown sender and has been hidden to protect your privacy.
I get about 4 of these every time I login to yahoo mail.
nfs mounted linux home directory fail
by nate on Dec.01, 2010, under Uncategorized
This an easy way to crush a linux box.
Take a linux box, export one disk say sdb as /export/home.
Then take a gigs of files from a second disk, sda and copy them to sdb.
Take a second machine, call it hapless user. Hapless user gets its homedir from the first linux box.
Any users using a remote machine sharing their homedirs from this machine will now basically be unable to work while the io grinds.
Why the OS/nfs is so unable to process heavy spikes in io from one source to the point of locking out and crashing remote hosts over nfs I dont know. Nfs is a mixed blessing, perhapse some magical tweaking of soft and other mount flags could prevent this but I doubt it. In 2010 computer tech is still relatively primative in that its easy to send a machine into a chaotic self destruct spiral with a few commands. Nfs timeouts cause all sorts of local crashes and gui interruptions, most apps deal with home dir settings flies and timeout weirdly when their homedir goes away suddenly.
So I ended up using a user account that wasnt nfs mounted while moving files around on the nfs server, otherwise it was total linux meltdown.
Notes:
Reading from a single sda drive to a 4disk RAID5 of 4 drives. Got iotop scores of ~7-11M/s of write in this configuration with an older lsi card.
squeeze/sid 2.6.32-24-generic #43-Ubuntu SMP x86_64 GNU/Linux
Game Table RC8 RPMs and Debs
by nate on Nov.21, 2010, under Open Source Linux, RPM
Game Table Rocks! I use it for Rifts. Because I am such a fan I have created packaged versions of it for Redhat and Debian distros!
Note that these packages assume you have java installed correctly.
smartmontools-5.39.1-1.x86_64.rpm
by nate on Apr.29, 2010, under Open Source Linux, RPM
AFAIK there are no smartmontools rpms for version 5.39.1 for anything but fedora.
Here is a src rpm, and x86_64 binary that works with Scientific Linux 5.3, and probably centos.
I just took the spec from here:
ftp://194.199.20.114/linux/sourceforge/s/project/sm/smartmontools/smartmontools/5.36/smartmontools-5.36-1.src.rpm
Updated the version and source code and built the rpm. This was done because there are no current centos/scilin rpms for smartmontools which support MEGARAID cards.
Fedora Core 12 nVidia Corporation GeForce 7150 / nForce 630i Support
by nate on Feb.07, 2010, under Uncategorized
I recently bought a mobo with an integrated 512 MB video card. I cannot get it to work with nvidia drivers under linux! There does not seem to be any that work with 64b linux on the nvidia site.
The xorg configs that follow work but are buggy, logging out of X sometimes just results in a black screen with a blinking cursor, no login page. Also I noticed that using the nv driver instead of vesa results in a similar blinking cursor xcrash upon loading.
lspci -vvv
00:10.0 VGA compatible controller: nVidia Corporation GeForce 7150 / nForce 630i (rev a2) (prog-if
00 [VGA controller])
Subsystem: Biostar Microtech Int’l Corp Device 1407
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2
B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
Latency: 0
Interrupt: pin A routed to IRQ 20
Region 0: Memory at ed000000 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at d0000000 (64-bit, prefetchable) [size=256M]
Region 3: Memory at ee000000 (64-bit, non-prefetchable) [size=16M]
[virtual] Expansion ROM at 80000000 [disabled] [size=128K]
Capabilities:
Kernel driver in use: nouveau
Kernel modules: nouveau, nvidiafb
I have the following working xorg.conf but I would like 3d support:
Section “ServerLayout”
Identifier “X.org Configured”
Screen 0 “Screen0″ 0 0
InputDevice “Mouse0″ “CorePointer”
InputDevice “Keyboard0″ “CoreKeyboard”
EndSection
Section “Files”
ModulePath “/usr/lib64/xorg/modules”
FontPath “catalogue:/etc/X11/fontpath.d”
FontPath “built-ins”
EndSection
Section “Module”
Load “glx”
Load “extmod”
Load “dbe”
Load “dri”
Load “record”
Load “dri2″
EndSection
Section “InputDevice”
Identifier “Keyboard0″
Driver “kbd”
EndSection
Section “InputDevice”
Identifier “Mouse0″
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/input/mice”
Option “ZAxisMapping” “4 5 6 7″
EndSection
Section “Monitor”
Identifier “Monitor0″
VendorName “Samsung”
ModelName “SyncMaster 910t (Digital)”
HorizSync 30.0 - 96.0
VertRefresh 50.0 - 160.0
Option “dpms”
EndSection
Section “Device”
### Available Driver options are:-
### Values: : integer,
###
### [arg]: arg optional
#Option “SWcursor” # [
#Option “HWcursor” # [
#Option “NoAccel” # [
#Option “ShadowFB” # [
#Option “UseFBDev” # [
#Option “Rotate” # [
#Option “VideoKey” #
#Option “FlatPanel” # [
#Option “FPDither” # [
#Option “CrtcNumber” #
#Option “FPScale” # [
#Option “FPTweak” #
#Option “DualHead” # [
Identifier “Card0″
Driver “vesa”
VendorName “nVidia Corporation”
BoardName “GeForce 7150 / nForce 630i”
BusID “PCI:0:16:0″
EndSection
Section “Screen”
Identifier “Screen0″
Device “Card0″
Monitor “Monitor0″
SubSection “Display”
Viewport 1 0
Depth 24
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
EndSection
Gipplet rpms
by nate on Dec.26, 2009, under Open Source Linux, RPM
IN PROGRESS
Gipplet is an rpm for gnome which puts the ip in the taskbar. I liked it for users that didn’t know how to find their own ip, it makes coaching them over the phone a bit easier.
I built the rpm from source, ill post its specs soon.
Based on:
http://giplet.sourceforge.net/
Initial Giplet spec:
cat /usr/src/redhat/SPECS/giplet.spec
Name: giplet
Epoch: 1
Version: 0.1.8
Release: 0.1
Summary: Applet to show ip in gnome taskbar.
Group: User Interface/Desktops
License: GPL
URL: http://giplet.sourceforge.net/
BuildArch: noarch
Requires: python
Requires: gnome-python2-applet
Requires: pygtk2-devel
Requires: pkgconfig
Requires: libbonobo
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
An application to show the ip address of a machine in the gnome panel.
%prep
%setup -q
%build
./configure –prefix=/usr
make
%install
rm -rvf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%pre
%post
%postun
%files
%{_libdir}/giplet/giplet_globals.py
%{_libdir}/giplet/giplet_globals.pyc
%{_libdir}/giplet/giplet_globals.pyo
%{_libdir}/giplet/gipletprefs.py
%{_libdir}/giplet/gipletprefs.pyc
%{_libdir}/giplet/gipletprefs.pyo
%{_libdir}/bonobo/servers/GNOME_GipletApplet.server
%{_libdir}/giplet/giplet
%{_datadir}/giplet/giplet.glade
%{_datadir}/pixmaps/giplet.svg
%changelog
* Tue Oct 20 2009 Nathan Yehle
- Initial rpm spec
Zip Ship by Order Amount
by nate on Nov.18, 2009, under Open Source Linux
/*
Shipping Rates by Order Price Range and Zipcode
internet-goods.com modified version of zipship.php
calculates shipping price the same way but with
price ranges used in the same fields the original uses weights in.
$Id: zipship.php,v 1.27 2007/06/06 22:41:52 me
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003-2007 osCommerce - by mark enriquez
REVISION HISTORY
—————-
4/10/07 - fixed handling fee bug (THANKS DUX!!) and added REGEX zipcode matching.
REGEX NOW SUPPORTED! Due to popular demand, I’ve modified the code to allow cart
users to specify parts of zipcodes to set shipping rates to, using Regular Expression
(REGEX) matching conventions. For a quick primer on REGEX, look here…
http://regexlib.com/CheatSheet.aspx
This should allow unlimited control on setting postcode-based “zones” for your cart.
The most obvious use is to use the first few characters of the post/zip code (DO NOT
USE THE * CHARACTER!! THIS WILL MESS UP THE REGEX EVALUATOR!!!) that you want to match.
USAGE
BE CAREFUL TO USE THE MORE EXACT MATCHES IN THE HIGHER ZONES! This is a crucial
part of using this mod…if you use “329″ in, say Zone 4, and try to use “3294″ in Zone
3, THE PROGRAM WILL MATCH ALL 3294X post codes to ZONE 4 BEFORE matching it to 3294 in
ZONE 3!!
In general, be careful where to place your substring match characters, and DO NOT USE
the * character. I am pretty sure that and properly formed regular expression strings
will be evaluated correctly by my program, but to test your REGEX, go here…
http://regexlib.com/RETester.aspx
..and play with your ideas. If they work there, they will work in your cart.
USAGE
By default, the module comes with support for 3 postcode “zones”.
This can be easily changed by editing the line below in the zones constructor
that defines $this->num_zones.
Next, you will want to activate the module by going to the Admin screen,
clicking on Modules, then clicking on Shipping. A list of all shipping
modules should appear. Click on the green dot next to the one labeled
zipships.php. A list of settings will appear to the right. Click on the
Edit button.
PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD. Make sure you keep a
backup of your shipping settings somewhere at all times.
If you want an additional handling charge applied to orders that use this
method, set the Handling Fee field.
Next, you will need to define which postcodes are in each zone. Determining
this might take some time and effort. You should group a set of postcodes
that has similar shipping charges for the same weight. As an example, one
of my customers is using this set of postcodes/zones:
When you enter these postcode lists, enter them into the Zone X Zipcodes
fields, where “X” is the number of the zone. They should be entered as
five diget postcodes. They should be
separated by commas with no spaces or other punctuation. For example:
1: 32903,32937
2: 32901,32935
3: 32940,32904
Now you need to set up the shipping/deliver rate tables for each zone. Again,
some time and effort will go into setting the appropriate rates. You
will define a set of weight ranges and the shipping price for each
range. For instance, you might want an order than weighs more than 0
and less than or equal to 3 to cost 5.50 to ship to a certain zone.
This would be defined by this: 3:5.5
You should combine a bunch of these rates together in a comma delimited
list and enter them into the “Zone X Shipping Table” fields where “X”
is the zone number. For example, this might be used for Zone 1:
1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
12:19.1,13:20.55,14:22,15:23.45
The above example includes weights over 0 and up to 15. Note that
units are not specified in this explanation since they should be
specific to your locale.
CAVEATS
At this time, it does not deal with weights that are above the highest amount
defined. This will probably be the next area to be improved with the
module. For now, you could have one last very high range with a very
high shipping rate to discourage orders of that magnitude. For
instance: 999:1000
If you want to be able to ship to any postcode in the world, you will
need to enter every postcode into the zipcodes fields. For most
shops, you will not want to enter every postcode, and in fact this module
has NOT BEEN DESIGNED TO ENCOMPESS MANY POSTCODES. If a postcode is not
listed, then the module will add a $0.00 shipping charge and will
indicate that shipping is not available to that destination.
PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
It appears that the osC shipping system automatically rounds the
shipping weight up to the nearest whole unit. This makes it more
difficult to design precise shipping tables. If you want to, you
can hack the shipping.php file to get rid of the rounding.
Lastly, there is a limit of 255 characters on each of the Zipcode
Shipping Tables and Zone Countries. This limits you to 255/6 = 42
MAX zipcodes per zone. DO NOT ENTER MORE THAN 42 POSTCODES PER ZONE!!
:wq
Released under the GNU General Public License
*/
class zipshipbyorderamount{
var $code, $title, $description, $enabled, $num_zones;
// class constructor
function zipshipbyorderamount() {
$this->code = ‘zipshipbyorderamount’;
$this->title = MODULE_SHIPPING_HOMEZIPSHIP_TEXT_TITLE;
$this->description = MODULE_SHIPPING_HOMEZIPSHIP_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_HOMEZIPSHIP_SORT_ORDER;
$this->icon = ”;
$this->tax_class = MODULE_SHIPPING_HOMEZIPSHIP_TAX_CLASS;
$this->enabled = ((MODULE_SHIPPING_HOMEZIPSHIP_STATUS == ‘True’) ? true : false);
// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
$this->num_zones = 6;
}
// class methods
function quote($method = ”) {
//internet-goods.com global $order, $shipping_weight, $shipping_num_boxes;
global $order, $cart, $shipping_weight, $shipping_num_boxes;
//from freeamount.php, get order total and use that instead of weight
$cart_total = $cart->show_total();
$dest_zipcode = $order->delivery[’postcode’];
$dest_zone = 0;
$error = false;
// iterate through all the zones first
$reg = array();
for ($i=1; $i<=$this->num_zones; $i++) {
$zipcode_table = constant(’MODULE_SHIPPING_HOMEZIPSHIP_CODES_’ . $i);
$zipcode_zones = split(”[,]”, $zipcode_table);
for ($j = 0; $j < count($zipcode_zones); $j++) {
if (ereg(trim(strtoupper($zipcode_zones[$j])), trim(strtoupper($dest_zipcode)), $reg)) {
$dest_zone = $i;
break;
}
}
}
if ($dest_zone == 0) {
$error = true;
} else {
$shipping = -1;
$zipcode_cost = constant(’MODULE_SHIPPING_HOMEZIPSHIP_COST_’ . $dest_zone);
//find the rate for this zip and weight
//except we hack it to check against order cost not weight
$zipcode_table = split(”[:,]” , $zipcode_cost);
$size = sizeof($zipcode_table);
for ($i=0; $i<$size; $i+=2) {
// if ($shipping_weight <= $zipcode_table[$i]) {
if ($cart_total <= $zipcode_table[$i]) {
$shipping = $zipcode_table[$i+1];
//internet-goods.com commented out $shipping_method = MODULE_SHIPPING_HOMEZIPSHIP_TEXT_WAY . ‘ ‘ . $dest_zipcode . ‘ : ‘ . $shipping_weight . ‘ ‘ . MODULE_SHIPPING_HOMEZIPSHIP_TEXT_UNITS;
$shipping_method = MODULE_SHIPPING_HOMEZIPSHIP_TEXT_WAY . ‘ ‘ . $dest_zipcode;
$feecounter = $tableIdx;
$tableIdx = $i + 1;
break;
}
}
if ($shipping == -1) {
$shipping_cost = 0;
$shipping_method = MODULE_SHIPPING_HOMEZIPSHIP_UNDEFINED_RATE;
} else {
$shipping_cost = ($shipping * $shipping_num_boxes) + constant(’MODULE_SHIPPING_HOMEZIPSHIP_HANDLING_’ . $dest_zone);
}
}
$this->quotes = array(’id’ => $this->code,
‘module’ => MODULE_SHIPPING_HOMEZIPSHIP_TEXT_TITLE,
‘methods’ => array(array(’id’ => $this->code,
‘title’ => $shipping_method,
‘cost’ => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes[’tax’] = tep_get_tax_rate($this->tax_class, $order->delivery[’country’][’id’], $order->delivery[’zone_id’]);
}
if (tep_not_null($this->icon)) $this->quotes[’icon’] = tep_image($this->icon, $this->title);
if ($error == true) $this->quotes[’error’] = MODULE_SHIPPING_HOMEZIPSHIP_INVALID_ZONE;
return $this->quotes;
}
function check() {
if (!isset($this->_check)) {
$check_query = tep_db_query(”select configuration_value from ” . TABLE_CONFIGURATION . ” where configuration_key = ‘MODULE_SHIPPING_HOMEZIPSHIP_STATUS’”);
$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}
function install() {
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES (’Enable Zipcode Method’, ‘MODULE_SHIPPING_HOMEZIPSHIP_STATUS’, ‘True’, ‘Do you want to offer Zipcode rate shipping/delivery?’, ‘6′, ‘0′, ‘tep_cfg_select_option(array(\’True\’, \’False\’), ‘, now())”);
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values (’Tax Class’, ‘MODULE_SHIPPING_HOMEZIPSHIP_TAX_CLASS’, ‘0′, ‘Use the following tax class on the shipping/delivery fee.’, ‘6′, ‘0′, ‘tep_get_tax_class_title’, ‘tep_cfg_pull_down_tax_classes(’, now())”);
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (’Sort Order’, ‘MODULE_SHIPPING_HOMEZIPSHIP_SORT_ORDER’, ‘0′, ‘Sort order of display.’, ‘6′, ‘0′, now())”);
for ($i = 1; $i <= $this->num_zones; $i++) {
$default_zipcodes = ”;
if ($i == 1) {
$default_zipcodes = ‘32903,32937′;
$default_dlvtable = ‘4:5,10:6,99:10′;
} else if ($i == 2) {
$default_zipcodes = ‘32901,32935′;
$default_dlvtable = ‘4:7,10:10,99:13.50′;
} else if ($i == 3) {
$default_zipcodes = ‘32951,32940′;
$default_dlvtable = ‘4:10,10:15,99:17.50′;
}
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (’Zone ” . $i .” Zipcode(s)’, ‘MODULE_SHIPPING_HOMEZIPSHIP_CODES_” . $i .”‘, ‘” . $default_zipcodes . “‘, ‘Comma separated list of 5-diget zipcodes that are part of Zone ” . $i . “.’, ‘6′, ‘0′, now())”);
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (’Zone ” . $i .” Shipping/Delivery Fee Table’, ‘MODULE_SHIPPING_HOMEZIPSHIP_COST_” . $i .”‘, ‘” . $default_dlvtable . “‘, ‘Shipping rates to Zone ” . $i . ” destinations based on a group of maximum order weights. Example: 4:5,8:7,… weights less than or equal to 4 would cost $5 for Zone ” . $i . ” destinations.’, ‘6′, ‘0′, now())”);
tep_db_query(”insert into ” . TABLE_CONFIGURATION . ” (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (’Zone ” . $i .” Handling Fee’, ‘MODULE_SHIPPING_HOMEZIPSHIP_HANDLING_” . $i.”‘, ‘0′, ‘Handling Fee for this Zipcode’, ‘6′, ‘0′, now())”);
}
}
function remove() {
tep_db_query(”delete from ” . TABLE_CONFIGURATION . ” where configuration_key in (’” . implode(”‘, ‘”, $this->keys()) . “‘)”);
}
function keys() {
$keys = array(’MODULE_SHIPPING_HOMEZIPSHIP_STATUS’, ‘MODULE_SHIPPING_HOMEZIPSHIP_TAX_CLASS’, ‘MODULE_SHIPPING_HOMEZIPSHIP_SORT_ORDER’);
for ($i=1; $i<=$this->num_zones; $i++) {
$keys[] = ‘MODULE_SHIPPING_HOMEZIPSHIP_CODES_’ . $i;
$keys[] = ‘MODULE_SHIPPING_HOMEZIPSHIP_COST_’ . $i;
$keys[] = ‘MODULE_SHIPPING_HOMEZIPSHIP_HANDLING_’ . $i;
}
return $keys;
}
}
?>
MySQL Slave Creation script
by nate on Oct.20, 2009, under Open Source Linux
#!/bin/sh
#this script is meant to be run from a slave node, it will create a slave relationship to a master node
#the master node is defined as MASTER_HANDLE using the shmysql scripts to execute sql
#you will need shmysql installed for any of this to work
MASTER_HANDLE=`shmysql host=masterhost.com dbname=example_db user=repl_user password=password`
#lock tables before getting master settings keep session open with shellsql
shsql $MASTER_HANDLE “FLUSH TABLES WITH READ LOCK”
echo “locked”
#while locked, dump master info, create and dump database into slave
echo “creating example_db”
echo create database example_db | mysql -uroot
echo starting dump
mysqldump –skip-opt example_db -h masterhost.com -urepl_user -ppassword –databases | mysql -uroot
echo “aquire master nfo”
MASTER_LOG_FILE=`echo SHOW MASTER STATUS | mysql -h masterhost.com -urepl_user -ppassword -N | awk ‘ {print $1} ‘`
MASTER_LOG_POS=`echo SHOW MASTER STATUS | mysql -h masterhost.com -urepl_user -ppassword -N | awk ‘ {print $2} ‘`
echo $MASTER_LOG_FILE
echo $MASTER_LOG_POS
#EXAMPLE ROWS=`shsql $HANDLE “select count(*) from SERVER”`
cat << EOF
CHANGE MASTER TO MASTER_HOST=’masterhost.com’, MASTER_USER=’repl_user’, MASTER_PASSWORD=’password’, MASTER_LOG_FILE=’$MASTER_LOG_FILE’, MASTER_LOG_POS=$MASTER_LOG_POS;
EOF
#echo $ENSLAVE_SQL
shsql $MASTER_HANDLE “UNLOCK TABLES”
echo “unlocked”
shsqlend $MASTER_HANDLE
echo SHOW MASTER STATUS | mysql -uroot
#TODO: script to add [mysqld] server-id=2 log-bin=mysql-binentry on slave my.cnf

