Skip to content

Instantly share code, notes, and snippets.

@metrofx
metrofx / wezterm.lua
Created August 7, 2024 06:08
WezTerm Config
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- config.default_prog = { 'pwsh.exe' }
config.default_prog = { 'ubuntu.exe' }
config.keys = {
{ key = 'q', mods = 'CTRL', action = wezterm.action.QuitApplication },
@metrofx
metrofx / hosts
Created November 4, 2018 02:58
Unblock Reddit in Indonesia: use these DNS records if you don't want to use VPN
151.101.193.140 reddit.com
151.101.65.140 reddit.com
151.101.1.140 reddit.com
151.101.129.140 reddit.com
151.101.193.140 www.reddit.com
151.101.65.140 www.reddit.com
151.101.1.140 www.reddit.com
151.101.129.140 www.reddit.com
151.101.193.140 www.redditstatic.com
151.101.65.140 www.redditstatic.com
0x0e6cDa245501Ed219D29234c7082197F7b7B0966
@metrofx
metrofx / random-commit.gitconfig
Last active August 1, 2017 04:06
Commit with random message
[user]
name = <yourname>
email = <youremail>
[core]
editor = vim
[push]
default = current
[alias]
wtc = !git commit -m \"$(curl -s whatthecommit.com/index.txt)\"
@metrofx
metrofx / keybase.md
Last active November 30, 2018 08:25

Keybase proof

I hereby claim:

  • I am metrofx on github.
  • I am metrofx (https://keybase.io/metrofx) on keybase.
  • I have a public key ASAJqzN2Z6glhe7rQcTe4d6PWHNe0i2BkNhneN1jYKNexgo

To claim this, I am signing this object:

@metrofx
metrofx / remove-xl-ads-from-your-site
Created February 2, 2016 10:11
Remove XL iframe ads from your site
<script type='text/javascript'>
if (!(parent && parent.WebPlayer) && top != self) {
top.location.replace(document.location);
alert('Untuk alasan keamanan, framing tidak diijinkan; klik OK untuk menghilangkan frame.');
}
</script>
@metrofx
metrofx / ElasticSearch.sh
Last active August 29, 2015 14:22 — forked from ricardo-rossi/ElasticSearch.sh
ElasticSearch install script for Ubuntu
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@metrofx
metrofx / pagespeed.sh
Created March 16, 2015 05:55
Measure web page load speed using curl
#!/bin/bash
CURL="/usr/bin/curl"
GAWK="/usr/bin/awk"
URL="$1"
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo "Host: $URL"
echo "Time_Connect Time_start_Transfer Time_total
$(echo $result | $GAWK -F: '{ print $1" "$2" "$3}')
" | column -t
@metrofx
metrofx / build-auto-adduser-script.sh
Last active August 29, 2015 14:00
Bulk-create linux users with auto-generated password.
#!/bin/bash
for userlist in `cat userlist.txt`
do
user=`echo $userlist | cut -f 1 -d ,`
pwd=`echo $userlist | cut -f 2 -d ,`
echo "useradd -m -s /bin/bash $user && echo $user:$pwd | chpasswd"
done
@metrofx
metrofx / hubot
Created April 13, 2014 16:21
Hubot custom launcher, using forever (https://github.com/nodejitsu/forever). Useful if you host Hubot in your own server.
#!/bin/sh
# Location: bin/hubot
# Hubot custom launcher, using forever (https://github.com/nodejitsu/forever).
# If you want to run hubot locally, don't call this script. run this instead:
# coffee node_modules/.bin/hubot
npm install
# put below path into hubot.env along with other hubot environment variables
# export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"