Linux
Show Installed Packages (including architecture)/Search for i386 Packages
by dervish on Mar.26, 2014, under Linux, Red Hat
# rpm -qa –qf “%{n}.%{arch}\n”
pciutils-devel.x86_64
pkgconfig.x86_64
libusb.x86_64
info.x86_64
desktop-file-utils.x86_64
m4.x86_64
ORBit2.x86_64
perl-Compress-Zlib.x86_64
mkisofs.x86_64
ttmkfdir.x86_64
…
# rpm -qa –qf “%{n}.%{arch}\n” | grep i386 | head
glib2.i386
libSM.i386
audiofile.i386
gmp.i386
pcsc-lite-libs.i386
libXrandr.i386
libXdamage.i386
pcsc-lite-devel.i386
libogg-devel.i386
db4-devel.i386
…
# yum list | grep i386 | head
GConf2.i386 2.14.0-9.el5 installed
NetworkManager.i386 1:0.7.0-13.el5 installed
NetworkManager-glib.i386 1:0.7.0-13.el5 installed
ORBit2.i386 2.14.3-5.el5 installed
OpenIPMI-libs.i386 2.0.16-16.el5 installed
aex-nsclt.i386 6.2-1378 installed
alsa-lib.i386 1.0.17-1.el5 installed
apr.i386 1.2.7-11.el5_6.5 installed
apr-util.i386 1.2.7-11.el5_5.2 installed
aspell.i386 12:0.60.3-13 installed
20140218: qpurge.sh
by dervish on Feb.18, 2014, under Linux, Scripts
#!/bin/bash
# Created 20131119 by Jamey Hopkins
# Cancel all jobs older than X days.
#
# Example: qpurge.sh 1 will cancel jobs older than prior day
# qpurge.sh 0 will cancel jobs older than current day
# Note: Use a regular cancel -a to cancel all jobs.
# 20131217 JAH – Display before and after counts.
# – Echo Checking queues and canceling job #.
# – Check for at least 2 files. There should be a control file and at least 1 data.
# 20140114 JAH – Exit if lpstat not found.
# 20140124 JAH – Strip preceding zeroes in job id
# 20140218 JAH – Added section for a plain cancel -a of specific queues
#
if [ “$1” = “” ]; then
echo Enter days to cancel.
echo Example: qpurge 1
exit 1
fi
if [ `id -un` != “root” ]; then
echo “Need to be root.”
exit 1
fi
if [ ! `which lpstat` ]; then
exit 1
fi
X=$1
echo “Checking queues…”
BEFORE=`lpstat -o | wc -l`
# cancel all jobs for specific queues here
#CA=”q1 q2 q3″
if [ -n “$CA” ]; then
echo “Canceling all jobs on: $CA”
cancel -a $CA >/dev/null 2>&1
fi
# clear jobs by age
find /var/spool/cups/d* -daystart -mtime +$X >qpurge.tmp 2>/dev/null
for FILE in `cat qpurge.tmp`
do
JOB=`basename $FILE | sed ‘s/d//g’ | cut -f1 -d-`
# strip preceding zeroes
JOB=`echo $JOB | sed ‘s/^0*//’`
INQ=””;INQ=`lpstat -o | grep — “-$JOB”`
if [ ! -e c${JOB}* -a “$INQ” != “” ]; then
echo Canceling $JOB
cancel $JOB >/dev/null 2>&1
fi
done
AFTER=`lpstat -o | wc -l`
echo;echo “Jobs Remaining ($AFTER of $BEFORE):”
lpstat -o
rm qpurge.tmp
echo
SSL Enabled
by dervish on Dec.05, 2013, under Linux
HTTPS has been enabled for the site.
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
by dervish on Nov.26, 2013, under Linux
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Solution:
chmod ugo-w /path/to/directory
20131119: qpurge.sh
by dervish on Nov.19, 2013, under Linux, Scripts
DO NOT USE: Use 20140218: qpurge.sh
#!/bin/bash
# Created 20131119 by Jamey Hopkins
# Cancel all jobs older than X days
# Example: qpurge 0 will cancel jobs not created on current day
if [ “$1” = “” ]; then
echo Enter days to cancel.
echo Example: qpurge 1
exit
fi
if [ `id -un` != “root” ]; then
echo “Need to be root.”
exit
fi
X=$1
echo “Total Jobs Before: `lpstat -o | wc -l`”
find /var/spool/cups/c* -daystart -mtime +$X >qpurge.tmp 2>/dev/null
for FILE in `cat qpurge.tmp`
do
basename $FILE | sed ‘s/c//g’ | xargs cancel
done
echo “Total Jobs After: `lpstat -o | wc -l`”
rm qpurge.tmp