bAbymAn's Tumblr
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”;

Posted via email from Evan’s posterous | Comment »

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/

Posted via email from Evan’s posterous | Comment »

If everything seems under control, you’re just not going fast enough.
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

Posted via email from Evan’s posterous | Comment »

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

Posted via email from Evan’s posterous | Comment »

suffering is optional
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

Posted via email from Evan’s posterous | Comment »

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.

Posted via email from Evan’s posterous | Comment »

verifying a computers listening ports using nmap
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

Posted via email from Evan’s posterous | Comment »

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

Posted via email from Evan’s posterous | Comment »