- $project - Sélectionnez, remodeler - 1:1
- $match - Filtrer - n:1
- $group - Agréger - n:1
- $sort - Trier - 1:1
- $skip - Sauter - n:1
- $limit - Limiter - n:1
- $unwind - Découper un champ (array) - 1:n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Extract the static image and video from a motion picture taken with a Huawei phone | |
''' | |
import os | |
import sys | |
from optparse import OptionParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up ssh-agent | |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
touch $SSH_ENV | |
chmod 600 "${SSH_ENV}" | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker exec -t CONTAINER_NAME mongodump -out /backups/dump_`date "+%Y-%m-%d-%H-%M-%S"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple benchmark for reversing a string in js - source https://medium.com/quick-code/5-ways-to-reverse-a-string-in-javascript-466f62845827 | |
function reverseFor(str){ | |
let reversed = ""; | |
for (var i = str.length - 1; i >= 0; i--){ | |
reversed += str[i]; | |
} | |
return reversed; | |
} | |
function reverseArray(str){ | |
return str.split("").reverse().join(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH Agent | |
# Note: ~/.ssh/environment should not be used, as it | |
# already has a different purpose in SSH. | |
# source : https://www.schoonology.com/technology/ssh-agent-windows/ | |
env=~/.ssh/agent.env | |
# Note: Don't bother checking SSH_AGENT_PID. It's not used | |
# by SSH itself, and it might even be incorrect | |
# (for example, when using agent-forwarding over SSH). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.hex = (d) => console.log((Object(d).buffer instanceof ArrayBuffer ? new Uint8Array(d.buffer) : | |
typeof d === 'string' ? (new TextEncoder('utf-8')).encode(d) : | |
new Uint8ClampedArray(d)).reduce((p, c, i, a) => p + (i % 16 === 0 ? i.toString(16).padStart(6, 0) + ' ' : ' ') + | |
c.toString(16).padStart(2, 0) + (i === a.length - 1 || i % 16 === 15 ? | |
' '.repeat((15 - i % 16) * 3) + Array.from(a).splice(i - i % 16, 16).reduce((r, v) => | |
r + (v > 31 && v < 127 || v > 159 ? String.fromCharCode(v) : '.'), ' ') + '\n' : ''), '')); |
This snippet of code was posted in 2014 and slightly revised in 2016 and 2017. It was more of a quick'n'dirty script than a polished tool. It is made only for Linux and in Python 2, which has since become outdated.
I currently do not use it, and I suggest you avoid it as well. Please do not expect support for using this script.
🔥 If you need an alternative, @glaucocustodio has kindly suggested EasyVPN in this comment.
The rest of the README is left for historical purposed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro | |
# | |
WP_OWNER=changeme # <-- wordpress owner | |
WP_GROUP=changeme # <-- wordpress group | |
WP_ROOT=/home/changeme # <-- wordpress root directory |
OlderNewer