Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am adamlacombe on github.
  • I am adamlacombe ( on keybase.
  • I have a public key ASCJWdFGMwWeKiM9n2vxNGe1OaQwxhQhlzstC15-yYzFlwo

To claim this, I am signing this object:

adamlacombe /
Created Mar 22, 2018
Reset PHP symlink to 7.1
View iis-log-regex.txt
(?P<timestamp>\S+ \S+) \S+ \S+ (?P<server_ip>\S+) (?P<method>GET|POST) (?P<url>.*?) \S+ (?P<port>\d+) - (?P<ip>\S+) (?P<http_version>\S+) (?P<extra>.*?) (?P<referrer>:- -|\S+) (?P<domain>\S+) (?P<status>\d+) .*
View nodemailer.js
import * as nodemailer from 'nodemailer';
let transporter = nodemailer.createTransport({
host: '',
port: 465,
secure: true,
auth: {
user: '',
pass: '',
adamlacombe / wsl2-replace-ip-in-hosts.ts
Created Jun 17, 2019
Replaces ip address in hosts file with the WSL2 container's ip
View wsl2-replace-ip-in-hosts.ts
import * as shelljs from 'shelljs';
import * as fs from 'fs';
let modifyHosts = ['somehost.tld', 'testing.localdev'];
(shelljs.exec(`ip addr | grep "scope global eth0"`, {async: true}).stdout as any).on('data', (data) => {
if (data.includes('scope global eth0')) {
let ip = data.replace('inet ', '').split('/')[0].trim();
let hosts = fs.readFileSync("/mnt/c/Windows/System32/drivers/etc/hosts", {encoding: 'utf-8'})
sudo apt-get install openssh-server
tar -xvzf ./nanominer-linux-1.4.0.tar.gz
cd nanominer-linux-1.4.0/
nano config.ini
./nanominer -d
wget --referer=
adamlacombe /
Created Dec 17, 2020
Convert multiple xlsx files to csv files then merge multiple csv files into one
for i in *.xlsx; do libreoffice --headless --convert-to csv "$i" ; done
awk '(NR == 1) || (FNR > 1)' *.csv > all.csv
adamlacombe / capitalize-names-in-csv.js
Last active Dec 18, 2020
Transform invite csv - capitalize name columns and lowercase emails
View capitalize-names-in-csv.js
`First Name,Last Name,Email
.map(r => r
.map((c, cIndex) => (cIndex === 2)
? c.toLowerCase()
: c.charAt(0).toUpperCase() + c.slice(1).toLowerCase())
docker run --name mysql -v /mysql-data:/var/lib/mysql -v /mysql:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -p 3306:3306 -d mysql
cloudflared tunnel --hostname --url http://localhost:3338