Skip to content

Instantly share code, notes, and snippets.

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

中野三玖 dagrons

🏠
Working from home
View GitHub Profile
@dagrons
dagrons / Emacs_Copy.xml
Created December 14, 2023 15:47
JetBrains PyCharm keymaps
<keymap version="1" name="Emacs copy" parent="Emacs">
<action id="AceAction">
<keyboard-shortcut first-keystroke="alt enter" />
</action>
<action id="ActivateTerminalToolWindow">
<keyboard-shortcut first-keystroke="alt f12" />
<keyboard-shortcut first-keystroke="alt j" />
</action>
<action id="Adtui.ZoomInAction">
<keyboard-shortcut first-keystroke="ctrl add" />
@dagrons
dagrons / ArchLinuxARM-M1
Created October 14, 2023 15:20 — forked from thalamus/ArchLinuxARM-M1
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu
@dagrons
dagrons / .condarc
Last active July 11, 2022 06:22
.condarc template for conda
channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true
ssl_verify: false
@dagrons
dagrons / setup.sh
Last active October 7, 2022 07:41
setup for clash
#!/bin/bash
set -e
# run as root
if [[ "$(whoami)" != "root" ]]; then
exit -1
fi
addgroup clash
@dagrons
dagrons / iptables.rules
Created July 2, 2022 11:27
iptables.rules for clash
# Generated by iptables-save v1.8.7 on Sat May 28 03:15:57 2022
*raw
:PREROUTING ACCEPT [10334:1353326]
:OUTPUT ACCEPT [9660:1339648]
COMMIT
# Completed on Sat May 28 03:15:57 2022
# Generated by iptables-save v1.8.7 on Sat May 28 03:15:57 2022
*nat
:PREROUTING ACCEPT [3:180]
:INPUT ACCEPT [0:0]
@dagrons
dagrons / latency.markdown
Created March 10, 2022 08:28 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@dagrons
dagrons / postgres-cheatsheet.md
Created February 28, 2022 03:13 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@dagrons
dagrons / iterm2.md
Created February 26, 2022 08:24 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@dagrons
dagrons / proxmox_resize_pve-root
Last active February 19, 2025 11:31
Proxmox - Resize pve-root lvm root expand
# Check disk space before
df -h
# Delete local-lvm storage in gui
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
@dagrons
dagrons / install_docker-cuckoo.sh
Last active October 4, 2022 08:30
mal installation
#!/bin/bash
# tested on ubuntu18.04-desktop
set -e
set -x
# confs
VBOX_USER=$(cat /etc/passwd|grep 1000|cut -d ':' -f 1)
VBOX_PASS="1205"