Skip to content

Instantly share code, notes, and snippets.

View ardinusawan's full-sized avatar
👍
lgtm

I Dewa Putu Ardi Nusawan ardinusawan

👍
lgtm
View GitHub Profile
@bioshazard
bioshazard / gun-service.sh
Created July 27, 2021 16:20
Automation for installing GunDB as a service (tested on Pi)
#!/bin/bash
## Usage: GUN_USER=gun GUN_ROOT=~gun/gun-pi-custom GUN_BRACH=master gun-service.sh
# Should be run as root (with sudo or directly)
[[ "$(whoami)" == "root" ]] || { echo "Must be run as root"; exit 1; }
# Setup default environment
[ -z "${GUN_USER}" ] && GUN_USER="pi"
GUN_DETECTED_USER_HOME=$(getent passwd ${GUN_USER} | cut -d: -f6)
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active May 5, 2024 19:32
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@Beneboe
Beneboe / how-to-setup-verified-commits.md
Last active March 20, 2024 18:20
How to Setup Verified Commits on Github
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 1, 2024 22:04
crack activate Office on mac with license file
@hopsoft
hopsoft / action_controller_parameters.rb
Created January 19, 2018 19:04
Manually & Recursively Filter Rails Params
module ActionControllerParameters
def filtered
filter_hash self.to_unsafe_hash
end
private
def filterer
@filterer ||= ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters)
end
@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@SehgalDivij
SehgalDivij / middleware.py
Last active December 21, 2023 11:34
Middleware in django to log all requests and responses(Inspired by another Github gist I cannot find the link to, now)
"""
Middleware to log all requests and responses.
Uses a logger configured by the name of django.request
to log all requests and responses according to configuration
specified for django.request.
"""
# import json
import logging
from django.utils.deprecation import MiddlewareMixin
@celso
celso / init.vim
Last active March 8, 2024 18:31
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@NathanGiesbrecht
NathanGiesbrecht / noip2.service
Last active February 24, 2024 01:32
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip2`
# 6) Execute `sudo systemctl start noip2`
@mjohnsullivan
mjohnsullivan / parse_json.go
Created December 14, 2015 23:17
Parse JSON objects with arbitrary key names in Go using interfaces and type assertions
// Parsing arbitrary JSON using interfaces in Go
// Demonstrates how to parse JSON with abritrary key names
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing
package main
import (
"encoding/json"
"fmt"
)