Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x727E3A21F2

Mert Akengin spacelatte

🤔
0x727E3A21F2
View GitHub Profile
@spacelatte
spacelatte / dyndns-cloudflare.py
Created August 3, 2020 01:19
cloudflare dynamic dns #ddns #dyndns public ip setter script
#!/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(
#!/usr/bin/env node
const EMAIL = "[email protected]";
const X_AUTH_KEY = "ABCDE";
const ZONE = "ABCDE";
const os = require("os");
const fetch = require("node-fetch");
const cf = require("cloudflare")({
email: EMAIL,
@spacelatte
spacelatte / tmux.readonly.c
Created July 25, 2020 14:20
#tmux #read #only #session this setuid executable allows you to connect other people's sessions as a readonly viewer
#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) {
@spacelatte
spacelatte / irc.echo.sh
Last active July 19, 2020 14:14
#irc #echo #bot #shell #bash #script #netcat
#!/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
@spacelatte
spacelatte / irc.exec.sh
Last active July 19, 2020 13:51
#irc #bot using #shell #bash #script #remote #exec #code #execution
#!/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
@spacelatte
spacelatte / stm32-lora-gw.ino
Created July 2, 2020 20:05
arduino stm32 lora master slave sensor device and gateway
#include <LoRa.h>
#include <Wire.h>
#include <I2CSoilMoistureSensor.h>
#define MAGIC 0x74736574 // "test"
#define BUTTON 1
static volatile bool ready = false;
static I2CSoilMoistureSensor sensor;
@spacelatte
spacelatte / gists.graphql
Last active August 28, 2023 11:48
github api v4 gists query graphql
query gistquery($name: String = "pvtmert", $count: Int = 100, $field: GistOrderField = UPDATED_AT, $sort: OrderDirection = DESC, $privacy: GistPrivacy = ALL) {
user(login: $name) {
gists(first: $count, orderBy: {field: $field, direction: $sort}, privacy: $privacy) {
nodes {
name
owner {
id
login
url
resourcePath
typedef void (*generic_function)();
typedef struct Allocation {
size_t size;
void *dataptr;
char usertag[1024];
generic_function *source;
struct Allocation *next;
} allocation_t;
@spacelatte
spacelatte / github.n0pe.me.zone
Created May 21, 2020 15:57
zone file for github pages
new.gh.n0pe.me. 1 IN A 185.199.111.153
new.gh.n0pe.me. 1 IN A 185.199.110.153
new.gh.n0pe.me. 1 IN A 185.199.109.153
new.gh.n0pe.me. 1 IN A 185.199.108.153
old.gh.n0pe.me. 1 IN A 192.30.252.154
old.gh.n0pe.me. 1 IN A 192.30.252.153
@spacelatte
spacelatte / reverse_polish.c
Created May 2, 2020 20:48
reverse polish (postfix) notation parser in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
typedef enum Type {
TYPE_NONE = 1<<0,
TYPE_OPERATOR = 1<<1,