Skip to content

Instantly share code, notes, and snippets.

View widianto's full-sized avatar
🏠
Working from home

Arif R Widianto widianto

🏠
Working from home
View GitHub Profile
@widianto
widianto / install_hugo_0.120.3.md
Created December 13, 2025 10:57 — forked from peterwake/install_hugo_0.120.3.md
Keeping an older version of Hugo on MacOS if Homebrew updates it

Installing Hugo 0.120.3 on macOS (Apple Silicon)

22 Feb 2025

My Hugo site stopped running locally, because Hugo and the theme I am using (Academic CV) switched dramatically from Bootstrap to Tailwind CSS, as well as a bunch of other behaviour changes. I don't have the time to update everything. But Homebrew had already updated Hugo to the latest version. And there's no option to simply tap an older version in Homebrew.

This guide documents the process of manually installing Hugo 0.120.3 on a Mac with an M1/M2/M3 processor and ensuring Homebrew does not update it. I thought I'd share it for anyone else with this problem. The usual disclaimers - you do this at your own risk, etc. etc.

0. Install the latest version using Homebrew

@widianto
widianto / DefaultKeyBinding.dict
Created December 12, 2025 04:09 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@widianto
widianto / Remap Mac Numeric Keypad Period to Comma in MacOS 14.6.md
Created October 11, 2024 01:10
Remap Mac Numeric Keypad Period to Comma in MacOS
  1. Using terminal, open and change to this folder: ~/Library/KeyBindings/
  2. Create (if unavailable) DefaultKeyBinding.dict file with content below:
{
   "#." = ("insertText:", ",");
}

Save and restart your Mac.

@widianto
widianto / redis.conf
Created October 16, 2021 03:27 — forked from luugiathuy/redis.conf
Redis configuration file
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@widianto
widianto / rails-7-ubuntu-mina-puma-nginx.md
Last active August 5, 2024 03:19 — forked from wafiq/rails-5-6-ubuntu-mina-puma-nginx.md
How to deploy Rails7 in Ubuntu VM using Mina deployment with Puma webserver and Nginx

Rails 7 Deployment with Ubuntu, Mina, Puma and Nginx

Based on this tutorial but simplified and inlined. Particularly removed any Rails and 3rd party services part, assumed you just need deployment to any Ubuntu machine.

Prerequisite

  1. A functional Rails app
  2. Hosted Git repository (Github, Bitbucket, Gitlab)
  3. Cloud hosting account (Digital Ocean, Vultr, Linode, Lightsail)
  4. Local SSH account
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>C9BD1ADE-4FD9-4842-A641-DFB373B7D42C</string>
<key>command</key>
<string>#!/usr/bin/env ruby
@widianto
widianto / tags.html
Created October 25, 2014 22:48
jekyll tags
---
title: Tags
permalink: /en/tags/
---
{% assign tags_sorted = site.tags | sort %}
{% for tag in tags_sorted %}
{% assign posts = tag[1] | where:"lang","en" %}
{% if posts.size > 0 %}
@widianto
widianto / country-select.html
Created October 4, 2014 12:51
List of country in select code
<select id="countries" name="countries">
<option value="AF">Afghanistan</option>
<option value="AX">�land Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@widianto
widianto / ubuntu_steps.sh
Last active August 29, 2015 14:07 — forked from johnrees/_ubuntu_steps.sh
Ubuntu nginx rails rbenv
# As root user
sudo su
# Update the OS
apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
export LC_ALL="en_US.UTF-8"
source ~/.bashrc