Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
@daluu
daluu / go-ssh-encrypted-pem.go
Created September 25, 2024 20:44 — forked from stefanprodan/go-ssh-encrypted-pem.go
Using golang ssh client with an encrypted private key
package main
import (
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net"
@daluu
daluu / git_gh_notes.md
Last active July 8, 2024 15:58
git and github notes
@daluu
daluu / loadUrlSynchronously.jsx
Created April 8, 2015 22:10
Loads data from a URL in Adobe Illustrator, synchronously! (Uses Bridge behind the scenes)
BridgeTalk.prototype.sendSynch = function(timeout) {
var self = this;
self.onResult = function(res) {
this.result = res.body;
this.complete = true;
}
self.complete = false;
self.send();
if (timeout) {
@daluu
daluu / Java-WebSocket-1.3.1-SNAPSHOT.pom
Last active August 1, 2023 19:55
Attaching a snapshot of a 3rd party JAR to maven as local repo with a maven based project - an example with Java-Websocket
<?xml version="1.0" encoding="UTF-8"?>
<!-- note that this is somefile.pom not pom.xml, and may not be the same data as in pom.xml -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<packaging>jar</packaging>
<name>Java WebSocket</name>
<version>1.3.1-SNAPSHOT</version>
<description>A barebones WebSocket client and server implementation written in 100% Java</description>
@daluu
daluu / docker_notes.txt
Last active August 1, 2023 19:46
Docker notes
docker system prune --volumes
docker run -u`id -u`:`id -g` -v $(pwd):/user/project -v ~/.aws:/user/.aws -v ~/.npmrc:/user/.npmrc -w /user/project -it --entrypoint /bin/bash circleci/node:12
# get compressed size of docker images (after they're pulled locally)
docker save image-name:latest > sizetest.tar
gzip sizetest.tar
ls -lh sizetest.tar.gz
# see https://github.com/docker/docker/issues/1143
@daluu
daluu / go_get_private_repos.txt
Last active March 26, 2023 08:51 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
```bash
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
```
@daluu
daluu / QEMU_ON_M1.md
Created May 5, 2022 05:34 — forked from citruz/QEMU_ON_M1.md
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

@daluu
daluu / shell_and_mac_notes.txt
Created February 25, 2022 01:04
Notes for Mac and shell cmds/scripts
shopt -s globstar
alias get-checksum='cd $1; find -type f -exec md5sum {} + | tee $2; cd -'
function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
alias speedtest='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip'
alias fixvpn="sudo route -n flush && sudo networksetup -setv4off Wi-Fi && sudo networksetup -setdhcp Wi-Fi"
@daluu
daluu / index.html
Created February 1, 2016 01:35
d3 Pareto Chart Example
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}