Skip to content

Instantly share code, notes, and snippets.

View trappedinspacetime's full-sized avatar
🏠
Working from home

Kenn trappedinspacetime

🏠
Working from home
  • For Personal Use
  • Istanbul
View GitHub Profile
@trappedinspacetime
trappedinspacetime / minimalist-netcat-usage-guide.md
Created June 3, 2019 18:43 — forked from Brainiarc7/minimalist-netcat-usage-guide.md
This gist contains basic usage examples of netcat tool, a feature-rich network debugging and exploration tool.

Minimalist Netcat usage examples:

Connect to TCP port 80 on host example.com:

nc -vv <hostname> 80

Port scan TCP ports 7 through 1023 on a specified host:

nc -v -z 7-1023

@trappedinspacetime
trappedinspacetime / gist:0c1375d4d8f5e7ef2062beb1152fa716
Created June 3, 2019 18:43 — forked from Hex29A/gist:0cbd42472018c2483b8b
Post commands to Sony Bravia TV with curl (volume down)
/usr/bin/curl -X POST -d '<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SendIRCC xmlns:u="urn:schemas-sony-com:service:IRCC:1"><IRCCCode>AAAAAQAAAAEAAAASAw==</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>' http://ip.to.tv/IRCC
@trappedinspacetime
trappedinspacetime / clients.c
Created June 5, 2019 13:34 — forked from frdmn/clients.c
MiniDLNA update interval patch
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "clients.h"
#include "getifaddr.h"
#include "log.h"
struct client_type_s client_types[] =
{
@trappedinspacetime
trappedinspacetime / youtube2mp4.js
Created June 10, 2019 17:07 — forked from svdoever/youtube2mp4.js
NodeJS Express service to convert YouTube url to mp4 url
const axios = require('axios');
const express = require('express');
// from https://codewithmark.com/learn-to-create-youtube-video-downloader
function qsToJson(qs) {
var res = {};
var pars = qs.split('&');
var kv, k, v;
for (i in pars) {
kv = pars[i].split('=');
@trappedinspacetime
trappedinspacetime / youtube2mp4.js
Created June 10, 2019 17:19 — forked from svdoever/youtube2mp4.js
NodeJS Express service to convert YouTube url to mp4 url
const axios = require('axios');
const express = require('express');
// from https://codewithmark.com/learn-to-create-youtube-video-downloader
function qsToJson(qs) {
var res = {};
var pars = qs.split('&');
var kv, k, v;
for (i in pars) {
kv = pars[i].split('=');
#define _GNU_SOURCE
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int get_prop_card32(Display *d, Window w, Atom p) {
Atom actual_type;
@trappedinspacetime
trappedinspacetime / orbit.c
Created October 21, 2019 13:25 — forked from rvaiya/orbit.c
Kensington Orbit scrollwheel as scroll toggle (x11).
/*
* Author: Raheman Vaiya
* License: WTFPL (do you really need one?)
* */
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
@trappedinspacetime
trappedinspacetime / output
Last active October 22, 2019 11:39 — forked from jordansissel/output
libxdo and WM_CLASS
% ./a.out $WINDOWID
Items: 22
Type: STRING
WM_CLASS[0]: terminator
WM_CLASS[1]: Terminator
#! /usr/bin/python2
import gtk.gdk
w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] )
w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1
gtk.gdk.window_process_all_updates()
gtk.gdk.flush()
# now bind this to super-r or something
#!/bin/bash
#
# watch cgroup 'browsers' memory activity
#
# best served with ...
#
# https://gist.github.com/jakewarren/477ecd1149abe908cbd5cf7a7c9abaa3
self=$0
SUDO=