Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
View GitHub Profile
<?php
# quick and dirty notes script. kst
$DESTINATION="/out/of/web/root";
error_reporting(0);
if(isset($_POST['notecontent']))
{
$ddir = date("Y-m-d-H-i-s");
# $mdir = date("Y/m");
$cdir = $DESTINATION."/".$ddir."-".rand().".txt";
<?php
# quick and dirty upload script.
# recommended to use destination out of the web root or you should do additional checks (like extension uploaded)
$DESTINATION="/out/of/web/root";
error_reporting(0);
if(isset($_FILES['images']))
{
$ddir = date("Y-m-d-H-i-s");
$cdir = $DESTINATION."/".$ddir;
@kost
kost / MACOSX-TINC.md
Last active November 10, 2021 10:58
tinc on Mac OS X example configuration using utun

MAC OS X, tinc and utun

tinc on Mac OS X example configuration using utun

IP allocations explained

My machine: 192.168.152.10

Remote machine: 192.168.152.5 (8.8.8.8)

#!/usr/bin/env python
#
# coding=utf-8
#
# Struts 2 DefaultActionMapper Exploit [S2-016]
# Interactive Shell for CVE-2013-2251
#'''
# improved shell (python3 and proper url encoding) by kost
# based on shell by:jonatas fil a.k.a dkr
#'''
ghdl --ieee=synopsys -fexplicit -frelaxed-rules --std=08 \
../../../../lattice/ulx3s/top/top_ulx3s_12f_xram_sdram.vhd \
../../../../lattice/ulx3s/clocks/clk_25_78_125_25.vhd \
../../../../lattice/ulx3s/clocks/clk_25_100_125_25.vhd \
../../../../lattice/ulx3s/clocks/clk_25_125_250_25_83.vhd \
../../../../lattice/ulx3s/clocks/clk_25_250_125_25_100.vhd \
../../../../lattice/ulx3s/clocks/clk_25_125_25_48_89.vhd \
../../../../lattice/ulx3s/clocks/clk_25_125_25_48_104.vhd \
../../../../lattice/ulx3s/clocks/clk_25_325_25_81.vhd \
../../../../lattice/ulx3s/clocks/clk_25_325_25_92.vhd \
@kost
kost / web-servers.md
Created April 2, 2020 08:22 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kost
kost / SimpleHTTPServer.cs
Created April 2, 2020 08:11 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@kost
kost / 25to12.sh
Last active February 2, 2020 09:51
ECP5 - repack 25f bitstream file to 12f
#!/bin/sh
# Repack 25f to 12f bitstream file.
# Usage: script <input> <output>
TMPECP5CONFIG=`mktemp`
ecpunpack --input "$1" --textcfg "$TMPECP5CONFIG" --idcode 0x41111043
ecppack --compress --input "$TMPECP5CONFIG" --bit "$2" --idcode 0x21111043
rm -- "$TMPECP5CONFIG"
@kost
kost / serialecho.py
Created January 28, 2020 21:04
Serial Echo in MicroPython
from time import sleep_ms
from machine import UART
def serialecho():
print("serial echo server started")
uart = UART(2) # 16:RX 17:TX
uart.init(baudrate=115200, bits=8, parity=None, stop=1)
while True:
if uart.any():
x=uart.read()
#!/bin/sh
# Create symlink farm for emard make files.
ECPBINSDIR=$(dirname `which ecppack`)
mkdir -p /mt/scratch/tmp/openfpga/vhd2vl/src
ln -sf `which vhd2vl` /mt/scratch/tmp/openfpga/vhd2vl/src/vhd2vl
mkdir -p /mt/scratch/tmp/openfpga/yosys
ln -sf `which yosys` /mt/scratch/tmp/openfpga/yosys/yosys
mkdir -p /mt/scratch/tmp/openfpga/nextpnr