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
const puppeteer = require('puppeteer'); | |
let scrape = async () => { | |
const browser = await puppeteer.launch({headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']}); | |
const page = await browser.newPage(); | |
await page.goto('https://99bitcoins.com/bitcoin-rich-list-top100/#addresses'); | |
await page.waitFor(1000); |
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
var request = require("request"); | |
var cheerio = require("cheerio"); | |
request({ | |
uri: "https://99bitcoins.com/bitcoin-rich-list-top100/#addresses", | |
}, function(error, response, body) { | |
var $ = cheerio.load(body); | |
var obj = {}; | |
$("table.t99btc-rich-list tr").each(function(i, elem) { |
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
[test@localhost ~]$ echo 'eval $(ssh-agent)' >> ~/.bash_profile | |
[test@localhost ~]$ ssh-keygen | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/home/test/.ssh/id_rsa): | |
Created directory '/home/test/.ssh'. | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in /home/test/.ssh/id_rsa. | |
Your public key has been saved in /home/test/.ssh/id_rsa.pub. | |
The key fingerprint is: |
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
// ==UserScript== | |
// @name SO_like_keyboards_shortcuts | |
// @namespace sputnick | |
// @include https://github.com/* | |
// @include https://gist.github.com/* | |
// @include https://*.slack.com/* | |
// @include https://stackoverflow.com/* | |
// @include hhttps://serverfault.com/* | |
// @include https://*stackexchange.com/* | |
// @include https://askubuntu.com/* |
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
apt install stubby | |
vi /etc/stubby/stubby.conf # enable 'Lorraine Data Network' (ou autre) | |
systemctl restart stubby | |
chattr -i /etc/resolv.conf | |
rm -f /etc/resolv.conf | |
echo 'nameserver 127.0.0.1' > /etc/resolv.conf | |
chattr +i /etc/resolv.conf |
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
$ printf '%s\n' a 2 z s 0.1 1.1 | sort -n | |
0.1 | |
a | |
s | |
z | |
1.1 | |
$ printf '%s\n' a 2 z s 0.1 1.1 | sort -V | |
0.1 | |
1.1 | |
2 |
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
$ cd /tmp | |
$ cat file | |
foobar | |
123 | |
$ sed 's/\w//g' file | |
$ sed 's/\d//g' file | |
foobar | |
123 |
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
sudo apt-get update && apt-get install openjdk-11-jre perl libxml2 libxml2-dev libxml-libxml-perl libwww-perl liblwp-protocol-https-perl | |
git clone https://github.com/sputnick-dev/saxon-lint.git | |
cd saxon-lint* | |
chmod +x saxon-lint.pl | |
./saxon-lint.pl --help |
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 | |
# https://stackoverflow.com/a/13401143/465183 | |
# Decimal ASCII codes (see man ascii) | |
ARR=( {48..57} {65..90} {97..122} ) | |
# Array count | |
arrcount=${#ARR[@]} |
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 | |
min_number=1 | |
max_number=10 | |
my_number=$(( RANDOM % max_number + min_number )) | |
read -p "Guess a number between $min_number and $max_number >>> " number_guess | |
case $number_guess in |