Skip to content

Instantly share code, notes, and snippets.

View anak10thn's full-sized avatar
🌴
Maaf gak di rumah

Ibnu Yahya (Eka) anak10thn

🌴
Maaf gak di rumah
View GitHub Profile
@anak10thn
anak10thn / genyproxy.md
Created February 20, 2024 05:20 — forked from mightymercado/genyproxy.md
Using an HTTP/S proxy with username/password in Genymotion

Install mitmproxy

brew install mitmproxy

Start mitmproxy with an upstream proxy

mitmproxy --mode upstream:https://host:port --upstream-auth=user:password

Create any genymotion android device in bridged network mode

Use 10.0.3.2:8080 as proxy in device

@anak10thn
anak10thn / rag-reranking-gpt-colbert.ipynb
Created January 22, 2024 05:56 — forked from virattt/rag-reranking-gpt-colbert.ipynb
rag-reranking-gpt-colBERT.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anak10thn
anak10thn / android-backup-apk-and-datas.md
Created November 2, 2023 11:16 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@anak10thn
anak10thn / README.md
Created September 18, 2023 15:40 — forked from billywhizz/README.md
readFileSync benchmark

File benchmarks in JavaScript

Requirement: We assume that have macOS or Linux. Windows is not supported.

Run the bash script script.sh (e.g., type bash script.sh). It will install nvm and bun in your user account, if needed.

The benchmark simply reads the current README.md file, as quickly as possible.

@anak10thn
anak10thn / README-setup-tunnel-as-systemd-service.md
Created September 2, 2023 22:55 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@anak10thn
anak10thn / mysql2sqlite.sh
Created June 11, 2023 12:43 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@anak10thn
anak10thn / README.md
Created March 2, 2023 12:40 — forked from porsager/README.md
A websocket middleware for express

A websocket middleware for express

A convenient way to expose a websocket connections in route handles.

Usage

const express = require('express')
    , ws = require('./ws')
@anak10thn
anak10thn / websocket-client.js
Created March 2, 2023 12:11 — forked from ErickWendel/websocket-client.js
Pure WebSocket Node.js Server using Native HTTP Module
// make a request
const options = {
port: 1337,
host: 'localhost',
headers: {
'Connection': 'Upgrade',
'Upgrade': 'websocket'
}
};
const protocol = 'http'

UPDATE:

These results are invalid. Some of the server implementations don't parse correctly and rust-tokio/ponylang-tcp don't seem to parse at all. See here for better benchmarks: https://gist.github.com/kprotty/5a41e9612657de00788478a7dde43d78

====

wrk -t4 -c128 -d10 --latency http://localhost:12345

  • Machine:
    • Intel Core i7-6700k (4 cores, 8 threads, 4.2ghz)
    • 16GB DDR4 2400mhz RAM
    • Arch Linux, Kernel 5.2.8
@anak10thn
anak10thn / download_file.rs
Created September 14, 2022 02:59 — forked from giuliano-macedo/download_file.rs
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};