Skip to content

Instantly share code, notes, and snippets.

@mailinglists35
mailinglists35 / switch-hyper-threading
Created September 25, 2018 15:10 — forked from zuyu/switch-hyper-threading
Switch on / off hyper threading.
#!/bin/bash
typeset -i core_id
typeset -i sibling_id
typeset -i state
for i in /sys/devices/system/cpu/cpu[0-9]*; do
core_id="${i##*cpu}"
sibling_id="-1"
if [ -f ${i}/topology/thread_siblings_list ]; then
needs this too or else...
cd .../tpg1/acl
set attribute generate_node_acls=1
set attribute demo_mode_write_protect=0
#enable DISCARD
cd /backstores/...
set attribute emulate_tpws=1
set attribute emulate_tpu=1
systemctl start vsftpd.service
yum reinstall $(repoquery --requires --recursive --resolve libusb ) --downloadonly --downloaddir=/var/ftp/pub/localrepo
createrepo --update /var/ftp/pub/localrepo
yum install libusb --downloadonly --downloaddir=/var/ftp/pub/localrepo
createrepo --update /var/ftp/pub/localrepo
@mailinglists35
mailinglists35 / watch samba
Created April 16, 2018 11:52
watch monitor email samba share modifications
# cat /usr/local/bin/watch_share.sh
#!/bin/bash
pkill -x inotifywait
cat /dev/null > /run/inotify.log
inotifywait --timefmt %T --format '%T %e %w %f' -m -r --excludei '^(.*)((~\$(.*)\.(doc|xls)(|x))|.*\.tmp)$' -e create -e delete -e modify -e move /srv/hostname/date/samba >> /run/inotify.log &
inotifywait --timefmt %T --format '%T %e %w %f' -m -r --excludei '^(.*)((~\$(.*)\.(doc|xls)(|x))|.*\.tmp)$' -e create -e delete -e modify -e move /srv/hostname/volatile/temp >> /run/inotify.log &
tail -f /run/inotify.log | sed -u -e 's/\/srv\/hostname\/date\/samba\//\\\\\\\\deptname\\\\projname\\\\/g' -e 's/\/srv\/hostname\/volatile\/temp\//\\\\\\\\deptname\\\\projname\\\\TEMP\\\\/g' | /usr/local/bin/check_share.sh
# cat /usr/local/bin/check_share.sh
#!/bin/bash
@mailinglists35
mailinglists35 / ffmpeg gps
Last active January 5, 2018 11:23 — forked from oeon/HowToStripAndFlip.md
How to remove GPS EXIF from iPhone .mov video
*say that you left your Location turned on and held your phone upside down. If you want to fix that, try this:*
strip: `ffmpeg -i input.mov -map_metadata -1 -vcodec copy -acodec copy output.mov` via http://askubuntu.com/questions/139570/how-do-i-remove-all-metadata-from-a-quicktime-movie-file (read comments)
flip: `ffmpeg -i in.mov -vf "vflip" out.mov` via http://superuser.com/questions/578321/how-to-flip-a-video-180-vertical-upside-down-with-ffmpeg (then to ffmpeg documentation)
$ sudo apt-get install dkms # if you've already installed dkms, skip this step.
$ sudo cp -R . /usr/src/mt7610u_sta-1.0
$ sudo dkms add mt7610u_sta/1.0
$ sudo dkms build mt7610u_sta/1.0
$ sudo dkms install mt7610u_sta/1.0
dkms.conf
PACKAGE_NAME=mt7610u_sta
PACKAGE_VERSION=1.0
ping 192.168.13.1 >nul: 2>nul:
if %ERRORLEVEL% == 0 goto end
net stop OpenVPNService
net start OpenVPNService
:end
PATH=/u01/app/oracle/product/12.2.0/dbhome_1/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
DATE='date +%Y%m%d'
09 21 * * * /home/oracle/jobs/bkp.sh >> /home/oracle/jobs/log/bkp_$($DATE).log 2>&1
#/home/oracle/jobs/log/bkp_`/usr/bin/date +%Y%m%d`.log 2>&1
#01 20 * * * logger ok
#DATE='date +%Y%m%d'
#07 21 * * * /home/oracle/jobs/bkp.sh >> /home/oracle/jobs/log/bkp_$($DATE).log 2>&1
#* * * * * /usr/bin/env > /home/oracle/cron-env
#* * * * * /bin/echo ok >> /tmp/`date +%Y%m%d` 2>&1
@mailinglists35
mailinglists35 / ipsec
Created November 2, 2017 15:06
ipsec
https://github.com/hwdsl2/setup-ipsec-vpn
https://github.com/trailofbits/algo
Puppet is a "Configuration Management" technology.
Ansible is an "Orchestration" technology.