ciphermethod.com

Linux

Ubuntu Missing Swap

by on Dec.13, 2014, under Linux, Ubuntu


Fix missing swap on Ubuntu derivatives when using encrypted home directories:

$ swapon -s
Filename Type Size Used Priority

$ free
total used free shared buffers cached
Mem: 1010504 905892 104612 16964 14460 370292
-/+ buffers/cache: 521140 489364
Swap: 0 0 0

$ sudo -s
# fdisk -l | grep swap
..
Disk /dev/mapper/mint--vg-swap_1: 1069 MB, 1069547520 bytes
..

# mkswap /dev/mapper/mint--vg-swap_1 # copy UUID shown into next cmdline
mkswap: /dev/mapper/mint--vg-swap_1: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 1044476 KiB
no label, UUID=08109738-64e7-4504-8bfd-2dff2011551d
# echo "RESUME=UUID=143c43d8-0a77-4d62-a7ae-f53a8e0229a9" > /etc/initramfs-tools/conf.d/resume
# echo "cryptswap1 /dev/sdb3 /dev/urandom swap,cipher=aes-cbc-essiv:sha256" > /etc/crypttab
# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-3.13.0-24-generic
Warning: No support for locale: en_US.utf8

# swapon -s
Filename Type Size Used Priority
/dev/mapper/mint--vg-swap_1 partition 1044476 316 -1
# free
total used free shared buffers cached
Mem: 1010504 863964 146540 16984 12820 326476
-/+ buffers/cache: 524668 485836
Swap: 1044476 316 1044160

Leave a Comment more...

Script: jbcleanup.sh

by on Oct.24, 2014, under Linux, Scripts


#!/bin/sh
# 20141024 - Jamey Hopkins
echo "Before: `ls *log* | wc -l` Files at `du -h . | cut -f1`"
[ 0 -ne `find *server.log -mtime +9 | wc -l` ] && find *server.log -mtime +9 | xargs gzip -v
[ 0 -ne `find *server.log.gz -mtime +30 | wc -l` ] && find *server.log.gz -mtime +30 | xargs rm
echo "After : `ls *log* | wc -l` Files at `du -h . | cut -f1`"

Leave a Comment more...

20140821 – Scan SCSI Bus for New Disk

by on Aug.21, 2014, under Linux

# 20140821 scan scsi bus for new disks (RHEL 5) – Jamey Hopkins
# echo 1 > /sys/block/sd?/device/rescan (RHEL 6)
cd /sys/class/scsi_host/
for h in `ls`; do echo $h;[ -f $h/scan ] && echo ‘- – -‘ >$h/scan;done
# use partprobe to throw error for unrecognized disk
partprobe

Leave a Comment more...

vsftpd respawning too fast, stopped

by on Apr.03, 2014, under Linux

# service vsftpd start
vsftpd start/pre-start, process 19503

# ftp localhost
ftp: connect: Connection refused
ftp>

# tail syslog
Apr 3 19:09:13 posix1c kernel: [5432924.750678] init: vsftpd main process (19514) terminated with status 1
Apr 3 19:09:13 posix1c kernel: [5432924.750692] init: vsftpd main process ended, respawning
Apr 3 19:09:13 posix1c kernel: [5432924.753473] init: vsftpd main process (19517) terminated with status 1
Apr 3 19:09:13 posix1c kernel: [5432924.753489] init: vsftpd main process ended, respawning
Apr 3 19:09:13 posix1c kernel: [5432924.756226] init: vsftpd main process (19520) terminated with status 1
Apr 3 19:09:13 posix1c kernel: [5432924.756240] init: vsftpd main process ended, respawning
Apr 3 19:09:13 posix1c kernel: [5432924.758928] init: vsftpd main process (19523) terminated with status 1
Apr 3 19:09:13 posix1c kernel: [5432924.758942] init: vsftpd main process ended, respawning
Apr 3 19:09:13 posix1c kernel: [5432924.761728] init: vsftpd main process (19526) terminated with status 1
Apr 3 19:09:13 posix1c kernel: [5432924.761743] init: vsftpd respawning too fast, stopped

# vsftpd
500 OOPS: unrecognised variable in config file: allow_writeable_chroot

# grep allow_writeable_chroot /etc/vsftpd.conf
allow_writeable_chroot=YES

Comment out:
# grep allow_writeable_chroot /etc/vsftpd.conf
#allow_writeable_chroot=YES

# service vsftpd start
vsftpd start/running, process 19652

Service stays up:
# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.5)
Name (localhost:user):

Leave a Comment more...

Show Installed Packages (including architecture)/Search for i386 Packages

by 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

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

But Wait, There's More!

A few highly recommended friends...