Skip to content

Instantly share code, notes, and snippets.

View kokizzu's full-sized avatar

Kiswono Prayogo kokizzu

View GitHub Profile
@kokizzu
kokizzu / sysctl.conf
Created September 1, 2021 06:03 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@kokizzu
kokizzu / pullpush.sh
Created August 31, 2021 17:36
PullPush: shortcut for add, commit, pull, push
#!/usr/bin/env bash
if [ $# -eq 0 ] ; then
echo "Usage:
./pullpush.sh 'the commit message'"
exit
fi
# format indentation
gofmt -s -w . # go fmt `find . -name '*.go' -type f`

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@kokizzu
kokizzu / result.txt
Last active July 8, 2021 01:53
Benchmark-Prime-2021-07-08
Single-threaded
┌───────┬────────────────┬──────────┬───────────────────────────────────────────────────────┬────────┬──────────┬─────────┬───────────┬──────────┬──────┬───────────────┐
│ Index │ Implementation │ Solution │ Label │ Passes │ Duration │ Threads │ Algorithm │ Faithful │ Bits │ Passes/Second │
├───────┼────────────────┼──────────┼───────────────────────────────────────────────────────┼────────┼──────────┼─────────┼───────────┼──────────┼──────┼───────────────┤
│ 1 │ cpp │ 3 │ flo80_constexpr │ 220667 │ 5.00002 │ 1 │ base │ no │ 1 │ 44133.26760 │
@kokizzu
kokizzu / gist:f8fd3d56145aa88d87a039bee97b703a
Created June 4, 2021 09:56 — forked from julianlam/expose-directory-on-host-to-lxc-container.md
Exposing a directory on the host machine to an LXC container

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.
@kokizzu
kokizzu / reclaimWindows10.ps1
Created June 2, 2021 01:27 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@kokizzu
kokizzu / go-resource.md
Created May 10, 2021 06:58 — forked from codenoid/go-resource.md
Some resources that have helped me learn golang over the last 3 years.

Some resources that have helped me learn golang over the last 3 years. I taught myself golang, it was a lot of grinding initially but I went through with it because I really liked the simplicity yet ability to be bare metal.

Here are some resources that have helped me in my journey. Sharing them here in case anyone is looking for study materials. [Disclaimer: These are links/notes collected over 3 years and not necessarily in order of expertise, but I will try my best to order them starting from basic ones and moving to more advanced resources]

Firstly - https://golang.org/ and https://golang.org/doc/ .Learn straight from the gophers mouth.

https://www.udemy.com/share/1013gw/ - Todd Mcloeds Course which I completed. Lays a strong and solid foundation of the most important golang concepts. I hope hes been updating his course. Highly recommend.

Tip: I created a repo while following the course. Helped drill the concepts in. Feel free to use this or or make something similar as your learn.

@kokizzu
kokizzu / ffmpeg.md
Created April 25, 2021 06:09 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@kokizzu
kokizzu / LICENSE
Created April 15, 2021 04:51 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: