Skip to content

Instantly share code, notes, and snippets.

View Eddy-Barraud's full-sized avatar

Eddy Barraud Eddy-Barraud

View GitHub Profile

ssh -L port-local:HOSTNAME:port-distant machine-distante

exemple, on veut rediriger le port 32400 (plex) de notre serveur headless vers le port 80 de notre ordinateur

ssh -L 80:127.0.0.1:32400 vps.example.com -N

-N : execute seulement le forward, ne lance pas de terminal distant

-R : inverse le sens (à la place de -L); on parle de remote port forwarding

Folder location of Win+X menus :

%LocalAppData%\Microsoft\Windows\WinX

SoftWare to edit the menus here

@Eddy-Barraud
Eddy-Barraud / phoronix-cmd.md
Last active September 2, 2018 14:05 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
<head>
<!-- Import the amp-gist component -->
<script async custom-element="amp-gist" src="https://cdn.ampproject.org/v0/amp-gist-0.1.js"></script>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<style amp-custom>
amp-gist {
margin: 1rem;
}
</style>
</head>
@Eddy-Barraud
Eddy-Barraud / random_alphanum.py
Created September 21, 2018 18:50
generate a random alphanumeric string with 16 keys
## generate a random alphanumeric string with 16 keys
import random, string
x = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
print(x)
from functools import reduce
from sympy import Symbol
X = Symbol('X')
def Lagrange(points):
P=[reduce((lambda x,y: x*y),[(X-points[j][0])/(points[i][0] - points[j][0]) for j in range(len(points)) if i != j])*points[i][1] for i in range(len(points))]
return sum(P)

PyInstaller Quickstart

Install PyInstaller from PyPI:

pip install pyinstaller

Go to your program’s directory and run:

pyinstaller yourprogram.py

It will generate an executable in a dist folder

// list loaded assets by our theme and plugins so we know what we're dealing with. This is viewed by admin users only.
add_action('wp_print_footer_scripts', 'wra_list_assets', 900000);
function wra_list_assets(){
if ( !is_admin() ){
return;
}
echo '&lt;h2&gt;List of all scripts loaded on this particular page.&lt;/h2&gt;';
echo '&lt;p&gt;This can differ from page to page depending of what is loaded in that particular page.&lt;/p&gt;';
@Eddy-Barraud
Eddy-Barraud / social_buttons_svg.html
Last active September 28, 2018 16:26 — forked from ishu3101/social_share.csv
Social Share URL
<style>
.resp-sharing-button__link,
.resp-sharing-button__icon {
display: inline-block
}
.resp-sharing-button__link {
text-decoration: none;
color: #fff;
}
@Eddy-Barraud
Eddy-Barraud / images_comrpess.sh
Last active October 6, 2018 16:20
Compress every images recursively with options to say quality & root path. Require jpegoptim & optipng
#!/bin/bash
usage()
{
echo "Usage: sh images_compress.sh -d /directory -q 60"
exit
}
while [ "$1" != "" ]; do
case $1 in
-d ) shift
DIRECTORY=$1