Skip to content

Instantly share code, notes, and snippets.

View cloudflare-tunnel.sh
# https://developers.cloudflare.com/argo-tunnel/quickstart
cloudflared tunnel --hostname my.domain.com --url http://localhost:3338
View docker-run-mysql.sh
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
@adamlacombe
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
john,doe,John.Doe@example.com
bobby,joe,Bobby.Joe@example.com`
.split('\n')
.map(r => r
.split(',')
.map((c, cIndex) => (cIndex === 2)
? c.toLowerCase()
: c.charAt(0).toUpperCase() + c.slice(1).toLowerCase())
.join(","))
@adamlacombe
adamlacombe / multiple-xlsx-to-single-csv.sh
Created Dec 17, 2020
Convert multiple xlsx files to csv files then merge multiple csv files into one
View multiple-xlsx-to-single-csv.sh
#!/bin/bash
# https://stackoverflow.com/a/21651707/9238321
for i in *.xlsx; do libreoffice --headless --convert-to csv "$i" ; done
# https://unix.stackexchange.com/a/558965
awk '(NR == 1) || (FNR > 1)' *.csv > all.csv
View install-miner.sh
sudo apt-get install openssh-server
wget https://github.com/nanopool/nanominer/releases/download/v1.4.0/nanominer-linux-1.4.0.tar.gz
tar -xvzf ./nanominer-linux-1.4.0.tar.gz
cd nanominer-linux-1.4.0/
nano config.ini
./nanominer -d
wget --referer=http://support.amd.com https://drivers.amd.com/drivers/linux/amdgpu-pro-19.20-812932-ubuntu-18.04.tar.xz
@adamlacombe
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'})
.split('\n');
View nodemailer.js
import * as nodemailer from 'nodemailer';
let transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
user: '',
pass: '',
},
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+) .*
@adamlacombe
adamlacombe / php-7-1-symlink.sh
Created Mar 22, 2018
Reset PHP symlink to 7.1
View php-7-1-symlink.sh
View keybase.md

Keybase proof

I hereby claim:

  • I am adamlacombe on github.
  • I am adamlacombe (https://keybase.io/adamlacombe) on keybase.
  • I have a public key ASCJWdFGMwWeKiM9n2vxNGe1OaQwxhQhlzstC15-yYzFlwo

To claim this, I am signing this object: