Skip to content

Instantly share code, notes, and snippets.

@deviousway
deviousway / frimware dell live iso
Last active February 20, 2018 02:49
update firmware on Dell servers on production from dell live iso (Centos7)
download iso from repo
https://www.dell.com/support/article/us/en/04/sln296511/updating-dell-poweredge-servers-via-bootable-media-iso?lang=en
mkdir -p /mnt/disk
mount -o loop download /mnt/disk
#where "download" is name of downloaded file.
yum install -y glibc.i686 procmail compat-libstdc++-33.i686 libxml2.i686 libstdc++.i686
cd /mnt/disk/drm_files/repository/System$$$$$$$
sh ./apply_components.sh
@deviousway
deviousway / lsof.txt
Created January 23, 2018 21:35
lsof command to find all things listening on ports
lsof -Pnl +M -i4 | grep LISTEN
@deviousway
deviousway / Cat_File_Without_Comments.txt
Created December 18, 2017 18:36
Cat a File, Without the Comments
cat $filename | egrep -v "^#"
or
cat $filename | egrep -v "(^#.*|^$)"
@deviousway
deviousway / exim_clean_queue
Created November 30, 2017 12:27
Exim Remove All messages From the Mail Queue
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
or
exim -bp | exiqgrep -i | xargs exim -Mrm
sed -i 's/oldstring/new string/g'
@deviousway
deviousway / create_mysl_db_and_user
Last active March 9, 2018 10:42
create_mysl_db_and_user
CREATE database $databasename;
CREATE USER '$newuser'@'localhost' IDENTIFIED BY '$password';
GRANT ALL PRIVILEGES ON $databasename.* TO '$newuser'@'localhost';
or to all
GRANT ALL PRIVILEGES ON *.* TO '$newuser'@'localhost';
Reset pass for mysql user
ALTER USER '$user'@'localhost' IDENTIFIED BY '$password' ;
@deviousway
deviousway / mount iso linux.txt
Last active January 27, 2018 08:14
mount iso linux
mkdir -p /mnt/disk
mount -o loop $$$$.iso /mnt/disk
yum install squashfs-tools
unsquashfs filesystem.squashfs
mv filesystem.squashfs /path/to/backup/
mount squashfs/LiveOS/ext3fs.img ext3fs -o loop
@deviousway
deviousway / plesk.txt
Last active November 8, 2017 11:36
Plesk
#Show email passwords.
/usr/local/psa/admin/sbin/mail_auth_view
@deviousway
deviousway / ffmpeg_mkv_to_mp4.txt
Last active November 8, 2017 11:37
ffmpeg mkv to mp4
for i in *mkv; do ffmpeg -i $i -vcodec copy -acodec copy $i.mp4; done
@deviousway
deviousway / ffmpeg_swap_chanel.txt
Last active November 8, 2017 11:36
ffmpeg swap audio channel in video
ffmpeg -i $input -map_channel 0.1.1 -strict -2 $output