Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
0x141A140E6

Mert Akengin pvtmert

🤔
0x141A140E6
View GitHub Profile
@pvtmert
pvtmert / reporter.py
Last active Jan 22, 2021
#web #exception #api #flask #python #python3 #reporter #crud
View reporter.py
#!/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
@pvtmert
pvtmert / tree.c
Last active Dec 18, 2020
#happy #new #year #c #quine
View tree.c
/*
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 *, ...);
@pvtmert
pvtmert / docker.touch.sh
Created Oct 4, 2020
#docker #hub #registry #pull #manifest #touch images to keep retention period of those from docker-hub's new policy ...
View docker.touch.sh
#!/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"
@pvtmert
pvtmert / airties.air.6372.so.md
Created Sep 5, 2020
#airties #modem #6372 #6372so #air6372 #air6372so #u-boot #uboot override #kernel #arguments and #parameters
View airties.air.6372.so.md

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)

@pvtmert
pvtmert / k8s.mk
Created Aug 29, 2020
kubernetes k8s makefile download tools utilities
View k8s.mk
#!/usr/bin/env make -f
TOOLS := \
kn \
k3d \
rke \
kind \
kops \
krew \
kubens \
@pvtmert
pvtmert / dyndns-cloudflare.py
Created Aug 3, 2020
cloudflare dynamic dns #ddns #dyndns public ip setter script
View dyndns-cloudflare.py
#!/usr/bin/env python3
# First create subdomain. Eg: laptop.example.com
# Then set parameters belog. Eg: subdom = "laptop"
# This script will fetch external public ip and set it as value.
# Make sure target record is A record!
import json, urllib.request
"""
urllib.request.install_opener(
View cloudflare-ddns.js
#!/usr/bin/env node
const EMAIL = "something@email.com";
const X_AUTH_KEY = "ABCDE";
const ZONE = "ABCDE";
const os = require("os");
const fetch = require("node-fetch");
const cf = require("cloudflare")({
email: EMAIL,
@pvtmert
pvtmert / tmux.readonly.c
Created Jul 25, 2020
#tmux #read #only #session this setuid executable allows you to connect other people's sessions as a readonly viewer
View tmux.readonly.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include <dirent.h>
int main(int argc, char **argv) {
@pvtmert
pvtmert / irc.echo.sh
Last active Jul 19, 2020
#irc #echo #bot #shell #bash #script #netcat
View irc.echo.sh
#!/bin/env sh
#set -x
set -o pipefail
PREFIX=usr_
NAME="${PREFIX}$(hostname | cut -d. -f1)"
INFO="$(uname -a) --- $(date)"
CHAN="${1:-#test}"
PING=10.0
@pvtmert
pvtmert / irc.exec.sh
Last active Jul 19, 2020
#irc #bot using #shell #bash #script #remote #exec #code #execution
View irc.exec.sh
#!/usr/bin/env bash
#set -x
set -o pipefail
PREFIX=usr
NAME="${PREFIX}$(hostname | cut -d. -f1)"
CHAN="${1:-#test}"
INFO="$(date) $(uname -a)"
PING=10.0