Read the install script before using it.
You may want to understand what the script is doing before executing it.
I will not be responsible for any damage caused to your server.
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
// Comma-separated values to JSON | |
function parseCSV(data) { | |
return parseDSV(data, ","); | |
} | |
// Tabulation-separated values to JSON | |
function parseTSV(data) { | |
return parseDSV(data, "\t"); | |
} |
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/sh | |
sudo apt-get remove $(dpkg -l|egrep '^ii linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`) | |
update-grub |
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
(function() { | |
String.prototype.asciiEncode = function() { | |
var i, result = []; | |
for (i = 0; i < this.length; i++) { | |
result.push("%", this.charCodeAt(i).toString(16)); | |
} | |
return result.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
#!/bin/sh | |
run() { | |
echo -en "# " | |
($@ 2>&1; echo $?>~/_$$) | log | |
V=$(($(cat ~/_L$$;rm -f ~/_L$$) / $(tput cols))) | |
if test 0 -eq $(cat ~/_$$;rm -f ~/_$$); then | |
echo -e "\r\033["$V"A\033[1;32m✓\033[0m\r\033["$V"B" | |
else | |
echo -e "\r\033["$V"A\033[1;31m✕\033[0m\r\033["$V"B" |
What we want is to allow John to connect through sftp only (no bash, no terminal) and to be limited to a set of folders.
In this example, we'll consider an existing user john
, whose home directory is /home/john
. You'll have to adapt the different commands to your specific case.
We need our user to customized a bit. First of all the, its home directory must be owned by root:
chown -c root:root /home/john
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
### Keybase proof | |
I hereby claim: | |
* I am e7d on github. | |
* I am e7d (https://keybase.io/e7d) on keybase. | |
* I have a public key whose fingerprint is 6324 5E8E 75A6 2FA4 17C2 81D3 F320 BE00 7C0B 8881 | |
To claim this, I am signing this object: |
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
Object.defineProperty(Number.prototype, 'fileSize', { | |
value: function humanFileSize(si = false) { | |
const divider = si ? 1e3 : 1024; | |
const i = Math.floor(Math.log(this) / Math.log(divider)); | |
const fileSize = | |
(this / Math.pow(divider, i)).toFixed(2) + | |
' ' + ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'][i] + | |
(si ? 'i' : ''); | |
return fileSize.toString(); | |
}, |
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
# Tail with proper line breaks in log files | |
function tail_linebreak() { | |
tail $@ | sed "s/\\\n/\\n/g" | |
} | |
alias tailn=tail_linebreak |
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
/** | |
* @author Michaël "e7d" Ferrand | |
* @description custom style for Visual Studio Code | |
* @see https://gist.githubusercontent.com/e7d/34cf097cd1fc3a7bbb7300b8fcd70d1c | |
*/ | |
/***** RESOURCES *****/ | |
@font-face { | |
font-family: 'Font Awesome'; |
OlderNewer