Your shopping cart is empty.

Latest Posts

The Joy of OpenSSL

Get into the correct directory:
cd /etc/pki/tls/certs

Generate key
openssl genrsa -des3 -out mike.key 4096
chmod 600 mike.key

Generate signing request
openssl req -new -key mike.key -out mike.csr
chmod 600 mike.csr

Get the CA to sign the request
openssl x509 -req -days 10000 -in mike.csr -out mike.cert \
-CA /etc/pki/tls/certs/army.ca/Army.ca_CA.cer \
-CAkey /etc/pki/tls/certs/army.ca/Army.ca_CA.key -CAcreateserial

Wireshark and tcpdump

Wireshark and tcpdump are extremely powerful network troubleshooting tools. Here are some command examples that may be useful.

SQL Command Reference

Deactivate all inactive users in the last year:

UPDATE `smf_members` SET `is_activated` = 0, `validation_code` = `dateRegistered`
WHERE (UNIX_TIMESTAMP() - `lastLogin`) / 86400 >= 365
AND (UNIX_TIMESTAMP() - `dateRegistered`) / 86400 >= 365;

Search and replace text in the "body" field (note that it must be updated in 2 places):

UPDATE smf_messages SET body = replace(body,'OLD','NEW');

Append a value to a field, if it's not already present:

Tags: 

SELinux

Getting SELinux working can be tough. Here are some commands I found useful.

Show the security context of a file:

ls -lZ

Copy the context from one file to another:

chcon --reference=<source> <destination>

Create a rule from an audit log (contained in /tmp/selinux):

/usr/bin/audit2allow -i /tmp/selinux

Explain an audit log (that appears in dmesg):

/usr/bin/audit2why -d

Reading an audit entry:

Kids Quotes

...because sometimes kids say the darndest things.

Sarah

Age 1-2

"Look at all the STUFF!" (Said to Annette, while she was getting in the shower.)
- 1998

"Holy Jesus, it's beautiful!" (Said about a newly added Christmas decoration.)
- December 1999

Age 3

"Daddy knows all about cheese in my hand." (Said to DJ when I went to get Sarah a cheese slice.)
- July 2000

Tags: 

How to check for an open relay

To see if yourserver.com is an open relay, you can run through the following sequence on any box that has a telnet client:

telnet yourserver.com 25
HELO myserver.ca
MAIL FROM:
RCPT TO:
DATA
From: "Relay Test"
To: Mike
Subject: Open Relay Test
This is a relay test. A properly configured mail server
should decline to relay this message.
 
.
QUIT

Using a Linux Webcam

It's actually surprisingly easy. Install fswebcam (preferably via RPM) and then run this command:

/usr/bin/fswebcam --quiet --background --loop 120 --skip 40 \
--timestamp "%d-%m-%Y %H:%M:%S (%Z)" --png --palette png \
--font /usr/share/fonts/liberation/LiberationMono-Regular.ttf \
--resolution 640x480 --info "The Bobbitt Family" --top-banner \
--save /var/www/webcam/webcam.png

Tags: 

Adobe Photoshop Tips

Colouring Pages

  • Open the image
  • Image --> Image Size --> 720x540
  • Image --> Mode --> Grayscale
  • Filter --> Sketch --> Photocopy
  • Settings
    • Detail: 2
    • Darkness: 25
  • Blur More

Army.ca Intro Pics

  • Image --> Adjustments Gradient Map to #003300 --> 009900 (reverse)
  • Filter --> Sketch --> Photocopy
  • Settings
    • Detail: 12
    • Darkness: 50
  • Image --> Adjustments Gradient Map to #003300 --> 009900 (reverse)

Secure, Automated Backups

After a fair amount of trial and error, I have finally discovered a way to back up files on one system over the Internet, to a remote system in a secure, automated way.

Tags: 

Windows Command Reference

Windows and command line go together like ice-cream and pickles, but there are actually some neat commands you can lean on to get things done. Here are some that I've discovered.

Tags: 

Pages