This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name "*.mkv" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -b:a 320000 -y "${FILE%.mkv}.mp3";' _ '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modify this file accordingly for your specific requirement. | |
# http://www.thegeekstuff.com | |
# 1. Delete all existing rules | |
iptables -F | |
# 2. Set default chain policies | |
iptables -P INPUT DROP | |
iptables -P FORWARD DROP | |
iptables -P OUTPUT DROP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: kodi | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: XBMC media centre | |
# Description: Starts the XBMC media centre in standalone mode | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LCD_PIN1=Arduino_PIN GND | |
LCD_PIN2=Arduino_PIN 5v | |
LCD_PIN3=Arduino_PIN GND + add resistors for | |
LCD_PIN4=Arduino_PIN 2 | |
LCD_PIN5=Arduino_PIN GND | |
LCD_PIN6=Arduino_PIN 3 | |
LCD_PIN11=Arduino_PIN 4 | |
LCD_PIN12=Arduino_PIN 5 | |
LCD_PIN13=Arduino_PIN 6 | |
LCD_PIN14=Arduino_PIN 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Sample input file (hosts.csv) | |
#server-new,172.16.158.35,22,deploy | |
#server-db,172.16.158.40,2211,deploy | |
#server-db-old,172.16.158.30,22,admin | |
#server-db-2,172.16.158.32,1111,user | |
cat hosts.csv | while read line | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# shyam jos | |
# Icinga plugin to check if server was rebooted less than 30 minutes ago | |
read -d. uptime < /proc/uptime | |
days=$(( uptime/60/60/24 )) | |
if (( uptime > 1800 )) | |
then | |
echo -n "OK! UP $days days | uptime_days=$days" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description="Systemd script for tcpdump" | |
After=network.target network-online.target | |
Wants=network-online.target | |
[Service] | |
User=root | |
ExecStart=/bin/bash -lc 'usr/sbin/tcpdump -i eth0 -C 10000 -G 86400 -w /var/log/tcpdumps/tcp_dump_$$(date +%%Y-%%m-%%d-%%H:%%M:%%S).pcap -z gzip -s 0' | |
SuccessExitStatus=143 | |
Restart=on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#lftp upload Script shyam jos 2017 | |
# turn off history substitution to allow special chars in password | |
set +H | |
LFTPDUSER="company_user" | |
LFTPDPASSWORD="4Po0ebL!@q5E" | |
#insert date for loging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install svn and git-svn packages in your local machine | |
sudo apt get install subversion git-svn | |
create a SVN repo for the git project you want to push | |
svn mkdir --parents --username myusername http://192.168.60.222:8181/svn/my_projects/my_git_app/trunk -m "new svn repo for git code" | |
#Initialize svn repo with git url | |
git svn init http://192.168.60.222:8181/svn/my_projects/my_git_app -s |