Submitted by bobbitt on Tue, 08/27/2013 - 13:50
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:
Submitted by bobbitt on Tue, 08/27/2013 - 13:47
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.
Submitted by bobbitt on Tue, 08/27/2013 - 13:43
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>
Submitted by bobbitt on Tue, 08/27/2013 - 13:40
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
Submitted by bobbitt on Tue, 08/27/2013 - 13:23
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:
Submitted by bobbitt on Mon, 08/26/2013 - 21:51
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
Included below are some commands that I have found, created or tweaked to help make life easier along the way.
Getting SELinux working can be tough. Here are some commands I found useful.
Is SELinux enabled?
Deactivate all inactive users in the last year:
Yes, some distros still use rpm.
Extract files from an RPM:
Get into the correct directory:
cd /etc/pki/tls/certs