Wednesday, April 29, 2009

Screen Howto

How to set up screen to allow multiple user access

RESTful Framework? ORM + CMS + Gateway Interface

Django works for RESTful backends to a flash frontend, but it's orm isnt that great and I'm not using the nice templating engine anyway. Its CMS on the other hand is killer.

I'm looking into what I can replace django with, ala cart like.
  • ORM - SQLAlchemy
  • CMS - FormAlchemy?
  • Gateway - Werkzeug? CherryPy?
Werkzeug so far looks to be REALLY nice. I define 'application' in a file and then point WSGIScriptAlias to it in my apache conf and it works (granted I take in and return the correct values).

Monday, April 27, 2009

Unix groups, users

On ubuntu (if you don't have access to the gui):

To create a user:
useradd -m -s /bin/bash *username*
passwd *username*
To create a group:
groupadd *groupname*
To add users to that new group:
usermod -a -G *groupname* *username*

Saturday, April 25, 2009

Traffic Saturday, April 25, 2009

Traffic sucks, but worse it seems to be unpredictable.. and not just because of accidents. I'll keeping track of some stats, just for the sake of keeping stats (I have a stupid theory atm that there's a relation to whether it's overcast or not..). I know Saturday sorta doesnt count as it's not a weekday, but I was really annoyed with traffic today so I started today.

heavy traffic - traffic (speeds <20 mph) before Crenshaw (Crunchshaw)
medium - traffic starts at Crenshaw
light - traffic starts at or after Washington Fairfax
none - drive at typical speeds (75mph) all the way to santa monica

weather: sunny/hot
traffic: heavy
time: 13:45-14:30

weather: dark
traffic: medium
time: 16:45-17:15

Tuesday, April 21, 2009

Mysql connection error 2003 (HY000) (146)

Tried logging into a remote mysql server and got an error:
ERROR 2003 (HY000): Can't connect to MySQL server on 'someserver' (146)
In this case, it was due to bind-address being set to 127.0.0.1in the /etc/my.cnf file (/opt/local/etc/my.cnf). The issue arose on a machine that used to be a slave after I had converted it back into a stand alone mysql server.

Saturday, April 18, 2009

Pro tip for the internet.

Shit is NOT sexy. If there's shit in your sex, you're just fucked up. Knock it off and get over it.

Thursday, April 16, 2009

Swapping ctrl and capslock on debian flavored linux-distros (ie ubuntu)

From the emacs-wiki http://www.emacswiki.org/emacs/MovingTheCtrlKey

1. chmod 644 /etc/default/console-setup then edit that file. Add an X11 style caps lock modification via:

 $ diff -U0 /etc/default/{console-setup.orig,console-setup}
--- /etc/default/console-setup.orig 2009-02-09 03:05:27.000000000 -0500
+++ /etc/default/console-setup 2009-02-09 04:11:20.000000000 -0500
@@ -40 +40 @@
-XKBOPTIONS=""
+XKBOPTIONS="ctrl:swapcaps"

you can do “ctrl:nocaps” instead if you want to two control keys.

2. Trick dpkg into integrating your changes:

 $ sudo dpkg-reconfigure console-setup

and choose all the defaults.

Note that this will only change capslock and ctrl in virtual terminals or when gnome or some other (lesser) window manager is not running.

To swap capslock and ctrl in gnome do:

System->Preferences-> Keyboard Preferences-> Layout tab-> Other Options (aka Layout Options) -> Ctrl key position-> Swap Ctrl and CapsLock radio button.

Wednesday, April 15, 2009

How to go to the restroom in a corporate environment

  1. Enter the stall, make sure the door closes behind you.
  2. Pull out around 5 squares (1 foot) of toilet paper and wipe down the toilet seat. Sprinkles on the lid could possibly seep through the butt-gasket.
  3. Place the butt-gasket on the toilet lid. Take care to make sure the most disastrous parts (the parts back by the buttocks) are covered. You're not going to pick up anything to vicious down by the legs. Lower all leg garments to the knee level and sit down. Lowering leg garments any further will only allow them to be potentially soiled on the floor. Pull the buttocks apart slightly as to help prevent any further fouling of the skin around the anus and buttocks.
  4. Evacuate the colon and, if necessary, the bladder. ONLY empty the bladder if necessary, if you don't have to evacuate the colon, then you are not to be using a stall.
  5. Do not worry about noises or smells offending others that may be in the bathroom with you. The sounds and smells that you make others endure is a sign of corporate dominance. On the other hand, if the smell offends you, then go ahead and flush it as soon as it escapes.
  6. Play some games and/or surf on your phone. This IS a requirement. This is part of your free time and is to be considered a break in the working routine to allow the R-mode brain to do some free thinking. Do not conduct any work or take calls. You need this time to be free from work such that when you do return to your work place, you are refreshed and ready to continue. This time should be kept to a 5 minute maxium as your legs and buttocks may go numb, hindering the wiping process in step 8.
  7. Once your colon has recovered from the evacuation, sit forward off of the toilet and butt-gasket. Do not sit back down as the gasket has most likely shifted and or possibly fallen down into the bowl.
  8. Pull out 1 to 1 1/2 feet of toilet paper and scrunch into a ball. Use this ball to wipe from back to front. A front to back movement is suitable as well, but contrary to popular pornographic knowledge,both wipe paths clean equally as well. Fold the toilet paper ball if appropriate. Repeat all of step 8 until no brown coloring resides on the toilet paper. If you see blood, it is only indicative that your anus is chapped. Continue wiping until there is no brown.
  9. Wipe or dab dry the urinary area. Return all garments to their previous positions.
  10. If the toilet is not motion sensing, use your foot to kick start the flush process.
  11. Wash your god damn hands with soap and water that is as hot as you can stand.
  12. After washing, use a paper towel to turn off the tap as well as on the door handle when exiting the bathroom. If no trash receptacle is near the door, simply let the towel fall to the ground. If the restroom provides only hot air blowers to dry your hands, do not attempt to turn off any taps and simply exit the restroom as quickly as possible. The high water costs incured by leaving the tap on will send a concise and articulate message that air blowers are simply unacceptable hand drying utilities. Use your pinky to open the door if the door pulls in or cover your hand with your shirt to turn the knob the door is configured with one.
Some notes on bathroom etiquette.
  1. If anyone ever attempts to converse with you for any reason other than an emergency while you are in the stall, it is correct and proper to remind them that it is unacceptable to conduct conversations with those already in the stalls.
  2. If a child under the age of 7 looks under the stall door directly at you, it is acceptable to use your foot and kick them in the head. For those over the age of 7, wait until all evacuations have completed before attacking.
  3. For all violent actions while in the restroom, remember that you are at your most vulnerable when you are evacuating your colon. There is not much you can do about this, but remember it anyway.