Skip to content

Instantly share code, notes, and snippets.

Étienne Ducharme b13bs

Block or report user

Report or block b13bs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View autossh.sh
autossh -f -D localhost:8082 -N -p22 username@server -i /home/user/.ssh/id_rsa
View gist:b302612ce95f73575ac957a24d38cb8d
/var/log/file.log {
weekly
rotate 7
compress
delaycompress
missingok
notifempty
create 0640 $user $group
}
View fix-clock-without-ntp.sh
date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
View compress-media.sh
### compress image
convert -resize 75% $filename $newfilename
### compress video
# get kbps with
ffmpeg -i $filename
# compress with (kbps/2)
@b13bs
b13bs / enc-dec.sh
Created Nov 18, 2018
Openssl symetric encryption
View enc-dec.sh
### TEXT FILE
# encrypt
openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
# decrypt
openssl aes-256-cbc -d -a -in secrets.txt.enc -out secrets.txt.new
### TAR
# encrypt
View hook.js
/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery-1.10.2.min.map
*/
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("o
@b13bs
b13bs / script.sh
Created Oct 10, 2018
run as root header in bash script
View script.sh
if [ "$EUID" -ne 0 ]
then echo "[-] Should be run as root!"
exit
fi
@b13bs
b13bs / zabbix_agentd.conf
Created Sep 21, 2018
Original zabbix agent config file
View zabbix_agentd.conf
# This is a configuration file for Zabbix agent daemon (Unix)
# To get more information about Zabbix, visit http://www.zabbix.com
############ GENERAL PARAMETERS #################
### Option: PidFile
# Name of PID file.
#
# Mandatory: no
# Default:
@b13bs
b13bs / auto-default-speaker.sh
Created Jul 7, 2018
Automatically switch output sound device when plugged in
View auto-default-speaker.sh
# https://askubuntu.com/questions/158241/automatically-change-sound-input-output-device
# Add this line in /etc/pulse/default.pa
load-module module-switch-on-connect
View aspnet-validate-xss-bypass.py
#!/usr/bin/env python3
# source: http://gosecure.net/2016/03/22/xss-for-asp-net-developers/
import urllib.parse
input_string = "<img src=xxx onerror=alert(1)>"
replacements = {"%3C": "%EF%BC%9C", "%3E": "%EF%BC%9E"}
encoded_string = urllib.parse.quote(input_string)
You can’t perform that action at this time.