Skip to content

Instantly share code, notes, and snippets.

View efraimsutopo's full-sized avatar

Efraim Sutopo efraimsutopo

  • Jakarta, Indonesia
View GitHub Profile
@efraimsutopo
efraimsutopo / date_plus_one_hour_utc.sh
Last active August 27, 2021 02:57
Date +1 hour with GNU & Busybox
# GNU
date -v +1H -u "+%Y-%m-%dT%H:00:00.000Z"
# Busybox
date -d@"$(( `date +%s`+3600))" -u "+%Y-%m-%dT%H:00:00.000Z"
@efraimsutopo
efraimsutopo / gist:cd2cbbd5614e02c90245a82b3ed5e72c
Created August 17, 2021 09:09
CELO Address for `Learn To Send CELO And CUSD`
0x8895eFfF7833222DC3e3c8450A79a88248665E4a
@efraimsutopo
efraimsutopo / 10_resume_wifi.sh
Last active September 20, 2020 14:26
Fix Ubuntu Wifi issue with (?) mark, put this file into /etc/pm/sleep.d
#!/bin/bash
case "$1" in
resume|thaw)
nmcli radio wifi off && nmcli radio wifi on
;;
esac

Choosing between multiple accounts at GitHub

If you have multiple accounts at a place like GitHub or Heroku, you'll have multiple ssh keys (at least one per account). To pick which account you want to log in as, you have to tell ssh which private key to use.

For example, suppose you had two GitHub accounts: foo and bar. Your ssh key for foo is ~/.ssh/foo_github_id and your ssh key for bar is ~/.ssh/bar_github_id. You want to access git@github.com:foo/foo.git with your foo account and git@github.com:bar/bar.git with your bar account. You would add the following to your ~/.ssh/config:

Host gh-foo
    Hostname github.com
 User git
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="$1"
CORRECT_NAME="$2"
CORRECT_EMAIL="$3"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@efraimsutopo
efraimsutopo / failed_to_install_wine-staging_on_ubuntu_18_04_missing_libfaudio.md
Last active July 31, 2020 06:10
Failed to install wine-staging on Ubuntu 18.04 (missing libfaudio)
  1. Purge all from APT!
sudo apt-get purge *wine*
  1. Check that there's no snaps installed too (for some reason i had this - not sure if it would impact so i assumed best to remove)
sudo snap remove wine
sudo snap update wine-platform-*
(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)|(?:".*(\/\/.*).*")|(?:".*\/\*.*\*\/.*")