View style.css
.box {
width: 100%;
height: 200px;
background: #0B0D2C;
position: relative;
}
.box:before,
.box:after {
content: '';
View README.md

Linux sudo GUI prompt

useful for applications that need to run scripts as root

(default ubuntu)

/usr/bin/pkexec --disable-internal-agent /bin/echo 'foo'
View killall.sh
ps aux | grep -i "Chrome" | awk '{print $2}' | xargs sudo kill
View tail.js
const {spawn} = require('child_process')
const proc = spawn('tail', ['-f', 'events.log'])
proc.stdout.on('data', data => {
process.stdout.write(data)
})
View index.js
fs.readFile('./certs/client.crt', 'utf8', (error, data) => {
const re = /[\s\S]*-----BEGIN CERTIFICATE-----\n([\s\S]*)\n-----END CERTIFICATE-----[\s\S]*/gi;
const cert = data.replace(re, '$1');
console.log(cert);
});
View random.js
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
View README.md

This command will show you the certificate (use -showcerts as an extra parameter if you want to see the full chain):

openssl s_client -connect the.host.name:443

This will get the certificate and print out the public key:

openssl s_client -connect the.host.name:443 | openssl x509 -pubkey -noout
View README.md

GNU screen quick reference

http://aperiodic.net/screen/quick_reference

How to Navigate, copy & paste content?

within screen sessions: Cntl a + [ : To start navigation using up/down arrow Press Space bar: To select content starting position

View example.js
<div>{'\u00A0'}</div>
View exists.js
var fs = require('fs');
var path = __dirname;
var filename = 'test.txt';
var files = fs.readdirSync(path);
var exists = files.includes(filename);
// true if file on disk is "test.txt",
// false if file on disk is "TEST.txt"