Your shopping cart is empty.

bobbitt's blog

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: 

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: 

SELinux

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

Is SELinux enabled?

sestatus

Disable SELinux without reboot (and only until the next reboot):

setenforce Permissive

Disable SELinux persistent:

vi /etc/sysconfig/selinux
SELinux=disabled

Show the security context of a file:

ls -lZ

Copy the context from one file to another:

chcon --reference=<source> <destination>

Linux Package Management Commands

Yes, some distros still use rpm.

Extract files from an RPM:

rpm2cpio filename.rpm | cpio -idv

Unpack an RPM into /tmp/deleteme without installing it:

rpm -ivh -root /tmp/deleteme --nodeps --noscripts package.rpm

Install

rpm -ivh

Upgrade (use this except for kernels)

rpm -Uvh

Find out what's installed

rpm -qa

See which package a file belongs to

rpm -qf

List files provided by a package

Tags: 

Linux Command Reference

Included below are some commands that I have found, created or tweaked to help make life easier along the way. I have collected them here so I can easily refer to them instead of buildling up the commands from scratch. Some are very simple, others are approaching "script" level. Hopefully others will find them useful as well.

Misc Linux Commands

Find and compress all PNG files under the apache web root:

Tags: 

Photography Notes

These are notes I have put together to help better use the features of my Fuji S602Z digital camera. While some notes may be specific to that camera model, others are general in nature and may help other amateur photographers with some basic concepts.

Please feel free to add notes to this page if you feel information is missing or inaccurate.

Pages

Subscribe to RSS - bobbitt's blog