Skip to content

Instantly share code, notes, and snippets.

@Hendrixer
Hendrixer / vsconfig.json
Created June 12, 2023 21:53
vs code config
{
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "One Dark Pro Darker",
"editor.tabSize": 2,
"editor.fontFamily": "'Fira Mono', Menlo, Monaco, 'Courier New', monospace",
"files.exclude": {
"**/.git": false
},
"editor.bracketPairColorization.enabled": true,
@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 10:37
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@haipnh
haipnh / intel-nvidia-offload-rendering.md
Last active April 25, 2024 10:37
Intel for display, NVIDIA for computing and offload rendering

Purposes

  1. iGPU will be used for main display and rendering daily-use softwares in default
  2. Dedicated GPUs will be used for computing or offload rendering
  3. Reduce the used VRAM of Dedicated GPU, which is mostly used for X11 server rendering

Tested Hardware Configuration

OS: Ubuntu 18.04.4 LTS
Mainboads
├── iGPU
@pertoft
pertoft / ceph-commands.txt
Last active April 25, 2024 10:37
Ceph command cheatsheet
ceph -w
ceph health detail
ceph osd df
ceph osd find
ceph osd blocked-by
ceph osd pool ls detail
ceph osd pool get rbd all
ceph pg dump | grep pgid
ceph pg pgid
@HerringtonDarkholme
HerringtonDarkholme / nihongo.cpp
Last active April 25, 2024 10:33
g++ nihongo.cpp
#define エスティーディー std
#define アイオーストリーム <iostream>
#define ユージング using
#define イフ if
#define インクルード #include
#define イント int
#define シーアウト cout
#define シーイン cin
#define ネームスペース namespace
#define ブール bool
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
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

@eenblam
eenblam / linux_reading_list.md
Last active April 25, 2024 10:25
Linux Networking Reading List

Linux Networking Reading List

Currently in no particular order. Most of these are kind of ancient.

Where's all the modern documentation? So much of what I've turned up searching is other folks complaining about having few options beyond reading source code.

The OREILLY books, while dated, seem to be some of the best available. Note that these can be read with a 7-day trial. Do this! At least get through the introduction section and first chapter of each to see if it's what you're after.

https://www.netfilter.org/

@mdonkers
mdonkers / server.py
Last active April 25, 2024 10:25
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@alexpreynolds
alexpreynolds / pandas_df_to_tabix_via_libraries.py
Last active April 25, 2024 10:26
Create an indexed tabix file from a Pandas dataframe via "pure" Python
#!/usr/bin/env python
'''
Create an indexed tabix file from a Pandas dataframe
via "pure" Python (i.e., no subprocess)
'''
import os
import io
import pandas as pd