Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
vpnwall-services / omp-commander.sh
Created May 14, 2018 17:10
[OMP Commander] Simplify OMP commands #linux #openvas #shell
#!/bin/bash
if [ -z "$1" ];then
echo "Command ?"
else
COMMAND="$1"
omp --host=localhost --port=9390 --username=admin --password=admin $COMMAND
fi
@vpnwall-services
vpnwall-services / requirements.sh
Last active May 14, 2018 18:56
[Python Rest API] Python example for building an API #linux #python #json #api
#!/bin/bash
cd /opt
mkdir sqlite3-databases ; cd sqlite3-databases
wget http://www.sqlitetutorial.net/wp-content/uploads/2018/03/chinook.zip
unzip chinook.zip ; rm chinook.zip
virtualenv venv
source venv/bin/activate
pip install flask flask-jsonpify flask-sqlalchemy flask-restful
pip freeze
@vpnwall-services
vpnwall-services / secu-recorder.sh
Last active May 22, 2022 19:33
[Secu Recorder] Start security cam #linux #script #bash #webcam
#!/bin/bash
# apt update ; apt install v4l-utils
# v4l2-ctl --list-devices
# compile usbreset.c
# cc usbreset.c -o usbreset
# lsusb
# sudo ./usbreset /dev/bus/usb/002/003
MYVAR=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
sleep 1
# Record
@vpnwall-services
vpnwall-services / first-push.sh
Last active May 14, 2018 21:11
[Github first push] Initialize folder for first push to Github #linux #initial #git
echo "# my project" >> README.md
git init
git add *
git commit -m 'initial commit'
git remote add origin https://github.com/user/project.git
git push -u origin master
@vpnwall-services
vpnwall-services / block-bad.sh
Last active May 14, 2018 23:19
[Block bad IP] Block abusing IP within Iptables #linux #shell #iptables #block
#!/bin/bash
#apt-get install dsniff cutter
echo -e "\nEnter IP you want to block :"
VAR=$1
if [ -z $VAR ]
then
clear
echo -e "\Please input IP and try again ..."
else
echo -e "\nOkay, lets do this ..."
@vpnwall-services
vpnwall-services / remote-forward.sh
Created May 14, 2018 23:53
[Remote port forwarding] Forward a local port to a localhost port on a ssh server #linux #ssh #port #forwarding
#!/bin/bash
# remote port 9000
# local port to forward 3000
ssh -R 9000:localhost:3000 user@example.com
@vpnwall-services
vpnwall-services / reactor-exec.sh
Last active May 21, 2018 15:47
[Push Reactor with Pillar data] Execute a event with data inside #linux #orchestration #saltstack #pillar #reactor #jinja
#!/bin/bash
# Push new dynamic public ip address
# to a dyndns server
salt-call event.send 'vpnwall/custom/event/updatedyndns' \
"{domainname: $(cat /etc/hostname), newip: $(https://icanhazip.com)}"
@vpnwall-services
vpnwall-services / disable-touchpad.sh
Last active December 8, 2018 15:30
[Disable Touchpad] Disable faulty touchpad on Dell Latitude E6410 #linux #script #touchpad #fault #bypass
#!/bin/bash
# disable touchstick on my dell
# xinput list
xinput --disable 13
@vpnwall-services
vpnwall-services / dateinvar.sh
Created May 22, 2018 17:28
[Date in variable name] Append $date to filename #linux #script #basics
#!/bin/bash
today=`date '+%Y_%m_%d__%H_%M_%S'`
filename="/home/el/myfile/$today.ponies"
echo $filename
@vpnwall-services
vpnwall-services / backuprestore.sh
Last active May 22, 2018 19:11
[BackupRestore] Backup and restore functions #linux #script #backup #rsync #menu #array
#!/bin/bash
#PUT DOMAIN NAMES IN THESES VAR
domainnames=("example.com" "example.net")
ctrl_c(){
echo -e "quitting ..."
exit 130;
}