Skip to content

Instantly share code, notes, and snippets.

View sputnick-dev's full-sized avatar
🚀
Open to opportunities

Gilles Quénot sputnick-dev

🚀
Open to opportunities
View GitHub Profile
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);
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) {
[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:
// ==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/*
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
$ 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
$ cd /tmp
$ cat file
foobar
123
$ sed 's/\w//g' file
$ sed 's/\d//g' file
foobar
123
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
#!/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[@]}
#!/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