Skip to content

Instantly share code, notes, and snippets.

@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active May 20, 2024 21:37
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@morfikov
morfikov / android_phone_as_a_LUKS_token.md
Last active May 20, 2024 21:35
How to use your Android phone as a key to your encrypted linux desktop/laptop system (LUKS/LUKS2 based)

About this HowTo

Encrypted systems (desktops/laptops) have one major problem when it comes to providing security over protected files. When you sit in front of your machine, you can feel safe because no one can break into the system without your knowledge. Moreover, if they try to do some bad actions, you can detect them and avoid the imminent danger. But what if you leave your laptop alone? Even if you think that you can lock it, turn it off or hibernate it, the machine still isn't secure as you would have thought. The problem lays in the physical access that people can get when you're not around and hence set some traps for you when you're not looking. To avoid the danger that comes

@earthbound19
earthbound19 / OklabExperiments.js
Last active May 20, 2024 21:34
rgb <-> oklab to/from convert, color blend through oklab space
// This gist contains JavaScript functions and tests for:
// - conversion from gamma-corrected (or gamma-compressed) sRGB to linear RGB, to Oklab
// - interpolation through Oklab
// - conversion back to linear RGB, then sRGB
// To use these tests, install nodejs, save this file locally, and run with:
// node OklabExperiments.js
// No other dependencies are required to use this.
// Thanks to some helpful folks in the generative art community for helping me better understand what's happening with this.
// My toddler smacked the keyboard with a piece of cardboard and made me accidentally type:
@rxmmah
rxmmah / bitcoin-price.sh
Created May 20, 2024 21:30
A Shell script to fetch and display bitcoin price
#!/bin/dash
#A Shell script to fetch bitcoin price and display !
#Author: Rammah Alensari
#Dependencies
# - jq https://stedolan.github.io/jq/
# - Nerd Font https://www.nerdfonts.com/ (or delete the bitcoin iccon)
bitcoin_price=$(curl -s https://api.coindesk.com/v1/bpi/currentprice.json | jq -r '.bpi.USD.rate ' | awk -F '.' '{print $1}')
echo "${bitcoin_price}" | cat
@KnightmareVIIVIIXC
KnightmareVIIVIIXC / news_blocklist.txt
Last active May 20, 2024 21:36 — forked from MohamedElashri/news_blocklist.txt
news outlet dns blocklist
!
! Title: Custom News Outlet Blocklist
! Description: Blocks major world-famous news outlets
!
||10nbc.com^
||10news.com^
||11alive.com^
||12news.com^
||13abc.com^
||13wmaz.com^
@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

@primaryobjects
primaryobjects / m3u8.md
Last active May 20, 2024 21:27
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@klmr
klmr / read_file.cpp
Last active May 20, 2024 21:23
“Canonical” code to slurp a file in C++17
auto read_file(std::string_view path) -> std::string {
constexpr auto read_size = std::size_t{4096};
auto stream = std::ifstream{path.data()};
stream.exceptions(std::ios_base::badbit);
auto out = std::string{};
auto buf = std::string(read_size, '\0');
while (stream.read(& buf[0], read_size)) {
out.append(buf, 0, stream.gcount());
}
@binki
binki / rendang-daging.md
Last active May 20, 2024 21:23
Beef Rendang (Rendang Daging)
import com.android.apksig.ApkSigner
import com.android.apksig.apk.ApkUtils
import com.android.apksig.internal.apk.v1.V1SchemeVerifier
import com.android.apksig.util.DataSource
import com.android.apksig.util.DataSources
def f = new RandomAccessFile(args[0], "r")
def apk = DataSources.asDataSource(f, 0, f.length())
def zipSections = ApkUtils.findZipSections(apk)
def cdRecords = V1SchemeVerifier.parseZipCentralDirectory(apk, zipSections)