Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x141A140E6

Mert Akengin spacelatte

🤔
0x141A140E6
View GitHub Profile
// author: mert akengin
short led = 13;
unsigned morse[256];
typedef enum time
{
unit = 100,
sh = 1*unit,
ln = 3*unit,
@spacelatte
spacelatte / tmux.c
Last active August 22, 2016 11:36
tmux guest session
// tmux.c
// compile using: cc -o tmux tmux.c
// makeit setuid executable by: chmod +s tmux
// also change owner to desired user: [sudo] chown {usernamehere} tmux
// give it to guests' shell (passwd entry): guest::9999:99:guest user:/tmp:/opt/tmux
// you can delete password with passwd -du {login}
// allow empty passwords with PermitEmptyPasswords yes in sshd_config
// update (18 aug 2016): added dynamic owner change, for security ofc :)
@spacelatte
spacelatte / brainfuck.c
Last active July 12, 2016 19:02
extended* Brainfuck interpreter in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h> // for int_max
#include <unistd.h> // for usleep (delay)
#include <math.h> // for log function
#define DEF_MEM_SIZE 32 // memory size
#define COLS 16 // print column count
@spacelatte
spacelatte / des_decrypt.c
Created July 18, 2016 12:13
attack modems' passwd files
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <signal.h>
#include <math.h>
#include <locale.h>
@spacelatte
spacelatte / checker.js
Last active December 2, 2016 16:57
check whois, ssl cert and smtp from node.js
#!/usr/bin/env node
const fs = require("fs");
const tls = require("tls");
const net = require("net");
const dns = require("dns");
const whois = require("whois");
const sql = require("sql.js");
const whoistabname = "whois";
@spacelatte
spacelatte / present.bashrc
Last active August 18, 2016 15:15
bash PS1 for presentations... paste it to your terminals initial command
export PS1='\[$(_EC=$?; if [ $_EC -ne 0 ]; then tput setaf 1; fi; printf "\]%3d" $_EC;) \[$(tput setaf 3;)\]\w$(__git_ps1 "\[$(tput sgr0;)\]:\[$(tput setaf 2;)\]%s";) \[$(tput setaf 7;)\]\$ \[$(tput sgr0;)\]'; tput clear;
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define flush fpurge
#define SEP "+-------------+------------------+---------------+---+"
#define LINE "| % 11d | %16s | %13lu | %1c |"
typedef struct {
@spacelatte
spacelatte / blog.php
Last active August 27, 2018 21:39
single script blog/messaging
<?php
const usertab = "users";
const posttab = "posts";
$db = new SQLite3("./blog.db",SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE);
if(!$db) die("error db");
ob_start();
session_start();
$sid = session_id();
header("x-author: mert akengin, put your custom header(s) here");
header("content-type: text/plain");
@spacelatte
spacelatte / makefile
Last active November 18, 2016 09:54
programmerid: is a number for defining your programming decisions and showing it.
#!/usr/bin/env make
all:
$(CC) -o programmertype programmertype.c
@spacelatte
spacelatte / disk.c
Last active October 10, 2016 18:31
disk managament/partitioning program in C (you can use arbitary files as disk images also)
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <locale.h>
#include <time.h>
#include <fcntl.h>