Evan's posterous http://www.codepit.ca Adventures in pomodoro and other such things posterous.com Sat, 03 Sep 2011 06:29:00 -0700 Database Schema Size http://www.codepit.ca/database-schema-size http://www.codepit.ca/database-schema-size

Query the size of each of the schemas defined on the database server:

SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;

Select the size of each of the tables defined in a schema:

SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "schema_name";

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sat, 31 Oct 2009 07:28:00 -0700 encrypting files using openssl http://www.codepit.ca/encrypting-files-using-openssl http://www.codepit.ca/encrypting-files-using-openssl

encrypt file.txt to file.enc using 256-bit AES in CBC mode

openssl enc -aes-256-cbc -salt -in file.txt -out file.enc

the same, only the output is base64 encoded for, e.g., e-mail

openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc

decrypt binary file.enc

openssl enc -d -aes-256-cbc -in file.enc

decrypt base64-encoded version

openssl enc -d -aes-256-cbc -a -in file.enc


thanks Mark, http://bolusmjak.posterous.com/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Tue, 20 Oct 2009 05:41:48 -0700 If everything seems under control, you’re just not going fast enough. http://www.codepit.ca/if-everything-seems-under-control-youre-just http://www.codepit.ca/if-everything-seems-under-control-youre-just Mario Andretti

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 18 Oct 2009 18:50:00 -0700 5 lines every sshd config should contain http://www.codepit.ca/5-lines-every-sshd-config-should-contain http://www.codepit.ca/5-lines-every-sshd-config-should-contain

to begin to properly secure your linux computer with ssh your sshd configuration file should contain the lines below.  These lines prevent root access, force public key authentication (no password to crack) and restrict access to named users only.

PermitRootLogin no
PasswordAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
AllowUsers babyman evan

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 18 Oct 2009 18:31:00 -0700 find every file modified between to dates http://www.codepit.ca/find-every-file-modified-between-to-dates http://www.codepit.ca/find-every-file-modified-between-to-dates
the following will find every file changed between 2 timestamps
touch temp -t 200910011130
touch ntemp -t 200910011630
find / -cnewer temp -and ! -cnewer ntemp

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Thu, 08 Oct 2009 17:47:23 -0700 suffering is optional http://www.codepit.ca/suffering-is-optional http://www.codepit.ca/suffering-is-optional

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Thu, 08 Oct 2009 06:06:00 -0700 snow leopard screen saver password delay http://www.codepit.ca/snow-leopard-screen-saver-password-delay http://www.codepit.ca/snow-leopard-screen-saver-password-delay

use the following to set the time between when screen saver activates and when a password is required to access the computer, the time is in seconds (10 in this case)

defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 10

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Tue, 25 Aug 2009 20:18:00 -0700 yoga etiquette tip #3 http://www.codepit.ca/yoga-etiquette-tip-3 http://www.codepit.ca/yoga-etiquette-tip-3

place your mat on the floor and unroll it, do not drop it, that huge CRACK! is not cool, ever!!! (for more on cracks see tip #1). If you are taking a hot yoga class try rolling your towel up in your mat when you're preparing your stuff the night before.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Wed, 19 Aug 2009 08:50:33 -0700 verifying a computers listening ports using nmap http://www.codepit.ca/verifying-a-computers-listening-ports-using-n http://www.codepit.ca/verifying-a-computers-listening-ports-using-n
one of the most reliable ways to determine which ports are accessible on a computer is to use nmap

nmap -sT -O localhost

alternately

netstat -an
lsof -i

but since these commands do not connect to the actual computer ports they are less reliable

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Wed, 05 Aug 2009 12:17:00 -0700 show installed packages using rpm http://www.codepit.ca/show-installed-packages-using-rpm http://www.codepit.ca/show-installed-packages-using-rpm

the following command will sort and show all of the rpm packages installed on a computer using less

rpm -qa | sort | less

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Thu, 30 Jul 2009 20:03:00 -0700 nmap http://www.codepit.ca/nmap http://www.codepit.ca/nmap

ever wonder what the IP address of that server in the corner is, you could always try scanning your network for computers using nmap.

sudo apt-get install nmap

to scan for running computers, here using sudo is optional but will provide more information, all others require root privileges

<sudo> nmap -sP 192.168.1.1/24

to scan for open ports on a computer

sudo nmap -sS 192.168.1.1/24

to include open ports and operating system information

sudo nmap -O 192.168.1.1/24

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Tue, 21 Jul 2009 17:41:00 -0700 yoga etiquette tip #2 http://www.codepit.ca/yoga-etiquette-tip-2 http://www.codepit.ca/yoga-etiquette-tip-2

when placing your mat look behind you and see if you are blocking anyones view of the mirror, if you are move over slightly if possible.  Respect your fellow students.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 19 Jul 2009 11:07:00 -0700 pomodoro cheat sheet http://www.codepit.ca/pomodoro-cheat-sheet http://www.codepit.ca/pomodoro-cheat-sheet

downloaded from Francesco Cirillo's (the creator of the Pomodoro Technique) website http://www.pomodorotechnique.com/ check there for even more Pomodoro related goodies. There is also an excellent book by describing the Pomodoro Technique in detail available as a free download here http://www.pomodoro-book.com/ 

pomodoro_cheat_sheet.pdf Download this file

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 19 Jul 2009 10:47:36 -0700 blocking flash in Safari and Firefox http://www.codepit.ca/blocking-flash-in-safari-and-firefox http://www.codepit.ca/blocking-flash-in-safari-and-firefox
to help keep your browsers memory footprint down you can install these neat plugins that prevent flash animations (including ads) from loading and starting automatically.

Firefox:
https://addons.mozilla.org/en-US/firefox/addon/433

Safari:

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 19 Jul 2009 09:10:00 -0700 yoga etiquette tip #1 http://www.codepit.ca/yoga-etiquette-tip-1 http://www.codepit.ca/yoga-etiquette-tip-1

if you must be at the front of the class get some proper shorts with a draw string, yoga is about focus but NOT focus on your crack!! If you're looking for that get a plumbing job.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Sun, 28 Jun 2009 10:51:52 -0700 python script template http://www.codepit.ca/python-script-template http://www.codepit.ca/python-script-template

#!/usr/bin/env python
"""
Some documentation:
Usage:
-h help
-r results file
"""
# Import libraries
import sys
import getopt
 
def process(arg):
  if arg.endswith(".results"):
   print_results(arg)
  else:
   print arg, "not recognized :'("
 
class Usage(Exception):
  def __init__(self, msg):
   self.msg = msg
 
def main(argv=None):
  if argv is None:
   argv=sys.argv
   try:
   # parse command line options
   try:
   opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
   except getopt.error, msg:
   raise Usage(msg)
   # process options
   for o, a in opts:
   if o in ("-h", "--help"):
   print __doc__
   return 0
   # process arguments
   for arg in args:
   process(arg)
   except Usage, err:
   print >> sys.stderr, err.msg
   print >> sys.stderr, "for help use -help"
   return 2
 
if __name__ == "__main__":
  sys.exit(main())

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Thu, 25 Jun 2009 15:25:00 -0700 spotlight on linux http://www.codepit.ca/spotlight-on-linux http://www.codepit.ca/spotlight-on-linux

if you use a mac and have made spotlight part of your workflow GNOME + Do (http://do.davebsd.com/) is really worth a look

Shot

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Thu, 25 Jun 2009 15:17:00 -0700 simple bash script template to process a file http://www.codepit.ca/simple-bash-script-template-to-process-a-file http://www.codepit.ca/simple-bash-script-template-to-process-a-file

#!/bin/bash
 
if [[ "$#" == 1 && -f $1 ]];
then
 # replace with something functional like 'rm -f $1'!
 echo "file $1 exists"
else
 echo "Usage: $0 "
fi

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Wed, 24 Jun 2009 09:59:32 -0700 creating a bootable usb drive from a .img file on OSX http://www.codepit.ca/creating-a-bootable-usb-drive-from-a-img-file http://www.codepit.ca/creating-a-bootable-usb-drive-from-a-img-file From https://help.ubuntu.com/community/Installation/FromImgFiles:

  • Download the desired .img file
  • Open a Terminal (under Utilities)
  • Run diskutil list to get the current list of devices
  • Insert your flash media
  • Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)
  • Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)
  • Execute sudo dd if=/path/to/downloaded.img of=/dev/diskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img). If you see the error dd: Invalid number `1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
  • Run diskutil eject /dev/diskN and remove your flash media when the command completes

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu
Tue, 23 Jun 2009 22:30:00 -0700 messing with maven http://www.codepit.ca/messing-with-maven http://www.codepit.ca/messing-with-maven

Of course no-one should ever need to use these switches but here they are ...
 
... to disable the pmd plugin

-Dpmd.skip=true 

... to disable the test phase 

-Dmaven.test.skip=true

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/61811/avitar.jpg http://posterous.com/users/15ZyPzcdlTP Evan Jehu bAbymAn Evan Jehu