Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x141A140E6

Mert Akengin spacelatte

🤔
0x141A140E6
View GitHub Profile
@spacelatte
spacelatte / t9.py
Created September 25, 2022 11:50
#t9 #keyboard #phone #converter #python3 #python #py
#!/usr/bin/env python3
"""
1 = abc
2 = def
3 = ghi
4 = jkl
5 = mno
6 = pqr
7 = stu
@spacelatte
spacelatte / karabiner.json
Created November 19, 2021 09:55
#karabiner #keyboard #kbd #mapping #map
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@spacelatte
spacelatte / docker-ssh-overlay-port-forward.mk
Last active May 18, 2021 17:23
#access #docker #ssh #port #forward #overlay #unpublished #internal #network
#!/usr/bin/env make -f
# ---
# USAGE:
# make -f {this_file} port-fwd/host.ssh/container_ip:container_port PORT_NETWORK=attachable-overlay-net
# FLOW:
# Fact: Creates SSH tunnel, docker port-binding and socat TCP proxy to gain access on a non-published port on a container which is inside an overlay network.
# Uses SSH forwarding to have: `localhost:$PORT_LOCAL -> ssh.host:$PORT_INTERMEDIATE_HOST`
# Uses Docker port binding to have: `ssh.host:$PORT_INTERMEDIATE_HOST -> container:$PORT_INTERMEDIATE_PROXY`
# Uses Socat TCP proxy to have: `container:$PORT_INTERMEDIATE_PROXY -> target_ip:target_port`
# The `target_ip:target_port` is the 3rd path element.
@spacelatte
spacelatte / find.c
Created March 31, 2021 08:48
#find files that their names are passed by arguments in current directory
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
@spacelatte
spacelatte / README.md
Last active May 4, 2021 09:46
#laika #python #client

laika-py: A Python Client for Laika Feature-Flag Service

Import this module to use Laika feature-flag service in your application.

You should use this like a database connection in your app. It should live within the application process, you should not initialize it per-request.

Basic usage is shown below:

@spacelatte
spacelatte / reporter.py
Last active January 22, 2021 09:54
#web #exception #api #flask #python #python3 #reporter #crud
#!/usr/bin/env python3
# start redis first:
# docker run --name=redis --rm -itdp 6379:6379 redis:latest
# install dependencies:
# python3 -m pip install -U flask redis
# run the app
# python3 reporter.py
@spacelatte
spacelatte / tree.c
Last active December 18, 2020 07:54
#happy #new #year #c #quine
/*
compile & run:
$ cc -o tree tree.c && ./tree \
| tee out.c
echo 'output:'
cc -o out out.c && ./out
*/
int main(){
int printf(const char *, ...);
@spacelatte
spacelatte / docker.touch.sh
Created October 4, 2020 14:22
#docker #hub #registry #pull #manifest #touch images to keep retention period of those from docker-hub's new policy ...
#!/usr/bin/env -S bash -xo pipefail
users=( "$@" )
baseurl="https://registry.hub.docker.com/v2"
#baseurl="https://registry-1.docker.io/v2"
function get_token {
local user="${1}"
local repo="${2}"
local scope="repository:${user}/${repo}:pull"
@spacelatte
spacelatte / airties.air.6372.so.md
Created September 5, 2020 21:02
#airties #modem #6372 #6372so #air6372 #air6372so #u-boot #uboot override #kernel #arguments and #parameters

Notes for Air6372SO

Last error message from dmesg:

D%G - Power failure detected. ADSL Link down.

The pinout of serial interface (from led-side, left-to-right)

@spacelatte
spacelatte / k8s.mk
Created August 29, 2020 18:52
kubernetes k8s makefile download tools utilities
#!/usr/bin/env make -f
TOOLS := \
kn \
k3d \
rke \
kind \
kops \
krew \
kubens \