Skip to content

Instantly share code, notes, and snippets.

View belmer's full-sized avatar

Belmer Salonoy belmer

View GitHub Profile
@belmer
belmer / machine.js
Created November 23, 2020 19:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@belmer
belmer / ducky.md
Created October 20, 2020 22:16
Ducky dedicated arrow keys

Set dedicated arrow keys for ducky mecha

For those who have model DKON2061ST, here is guide to switch arrangement of R-Alt, R-Windows, FN, and R-Ctrl.

  1. Set off all DIP-Switches (default)
  2. Press FN + Alt + K for 5 seconds
  3. (Optional) Pull off keycaps on R-Alt, R-Win, FN, and R-Ctrl so you won't get confused with the label. Remember Green light = R-Alt, Blue = R-Win, Indigo = FN, Purple = R-Ctrl
@belmer
belmer / machine.js
Last active October 18, 2020 12:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@belmer
belmer / purge_nvidia_drivers.md
Last active September 8, 2020 17:24
Remove all nvidia driver related packages

Remove all nvidia packages ,skip this if your system is fresh installed

sudo apt-get remove nvidia* && sudo apt autoremove

install some packages for build kernel:

sudo apt-get install dkms build-essential linux-headers-generic

now block and disable nouveau kernel driver:

@belmer
belmer / bluetooth_on_linux.md
Last active July 11, 2020 14:33
Bluetooth issue with Linux

If you have a problem with your bluetooth connectivity on linux. Below is the solution that worked for me. So I have a logitech Triathlon mouse that connects via bluetooth. This is an on-board bluetooth module. The problem started when I updated to version 20.04 of linux. After few seconds of inactivity, the bluetooth seems to sleep or suspend until you move your mouse again. This is very annoying in my case. So I find some solutions on the web, I've tried bunch of them But this one fixed it.

https://support.system76.com/articles/bluetooth/

This post all helps on a lot of bluetooth issues

@belmer
belmer / bluetooth_on_linux.md
Created July 3, 2020 16:31
Bluetooth issue with Linux

If you have a problem with your bluetooth connectivity on linux. Below is the solution that worked for me. So I have a logitech Triathlon mouse that connects via bluetooth. This is an on-board bluetooth module. The problem started when I updated to version 20.04 of linux. After few seconds of inactivity, the bluetooth seems to sleep or suspend until you move your mouse again. This is very annoying in my case. So I find some solutions on the web, I've tried bunch of them But this one fixed it.

So just run this on your terminal.

```btnum=rfkill list|grep hci0| cut -f 1 -d ':' rfkill block $btnum

@belmer
belmer / consoleLog.json
Created July 1, 2020 02:52
Sublime KeyBinding to auto add console.log on ctrl+c
[
{ "keys": ["ctrl+c"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
},
{ "keys": ["ctrl+alt+f"], "command": "js_prettier" },
{ "keys": ["ctrl+alt+t"], "command": "terminal_view_open" },
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
{
"color_scheme": "Packages/User/SublimeLinter/Oceanic Next (SL).tmTheme",
"detect_identation": true,
"disable_custom_title_bar": true,
"enable_tab_scrolling": false,
"extensions":
[
"js",
"jsx",
"sublime-settings"
@belmer
belmer / tmux-cheatsheet.markdown
Created February 5, 2020 18:54 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@belmer
belmer / SampleMenu.json
Created January 28, 2020 19:16
Sample Menu
[
{
"menus": [
{
"active": true,
"icon": "dashboard",
"key": "/portal/dashboard",
"primaryText": "Dashboard"
},
{