Skip to content

Instantly share code, notes, and snippets.

View sofianhw's full-sized avatar
💭
I may be slow to respond.

Sofian Hadiwijaya sofianhw

💭
I may be slow to respond.
View GitHub Profile
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
curl -O https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz
tar -xf Python-3.8.10.tar.xz
cd Python-3.8.10
./configure --enable-optimizations
make -j 4
@sofianhw
sofianhw / kitty.MD
Created February 27, 2023 09:09
Kitty

command + shift + i = set tab name control + shift + enter = add pane control + shift + l = change pane layout

@sofianhw
sofianhw / geth.sh
Created February 27, 2023 09:06
prysm + geth as node ethereum
# create folder
mkdir -p ethereum/consensus ethereum/execution
cd ethereum/consensus/
mkdir prysm && cd prysm
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh
# installing geth
cd ../../execution
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
@sofianhw
sofianhw / swap-linux.sh
Created February 27, 2023 07:28
swap-linux
# make swapfile
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
# mark as swap space
sudo mkswap /swapfile
# enable swap file
sudo swapon /swapfile
@sofianhw
sofianhw / hdwallet.go
Created October 18, 2022 08:06 — forked from miguelmota/hdwallet.go
Golang Ethereum HD Wallet implementation
package hdwallet
import (
"crypto/ecdsa"
"errors"
"fmt"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil/hdkeychain"
"github.com/ethereum/go-ethereum/accounts"
/**
*Submitted for verification at Etherscan.io on 2021-10-31
*/
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.3.2 (utils/Strings.sol)
pragma solidity ^0.8.0;
@sofianhw
sofianhw / odoo.conf
Created April 11, 2022 17:17
max odoo conn
[options]
db_maxconn = 800
max_cron_threads = 1
worker = 1
@sofianhw
sofianhw / aws-on-off.sh
Last active January 18, 2022 16:29
Script to stop, start, and check AWS EC2 state
#!/bin/bash
instancename=$1
cmd=$2
# get instances id
instanceid=$(aws \
ec2 \
describe-instances \
--filters 'Name=tag:Name,Values=*'${instancename}'*' \
--query 'Reservations[*].Instances[*].InstanceId' \
@sofianhw
sofianhw / dashboard.json
Last active October 13, 2021 15:40
Grafana HTTP Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",

https://www.cs.brandeis.edu/~dkw/C-humor/pasta.txt

                            LETTER TO THE EDITOR

The mention of "a feast of spaghetti code" ("Computer Collectives", CrossTalk, April/May 1992) prompted this response:

Nearly every software professional has heard the term spaghetti code as a pejorative description for complicated, difficult to understand,