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 / 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('=');
@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 / 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 / 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 / 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

#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@trappedinspacetime
trappedinspacetime / ldd.py
Created June 3, 2019 15:44 — forked from masami256/ldd.py
Execute ldd command to find commands that depend on given library name
#!/usr/bin/env python
import sys
import os
from subprocess import Popen, PIPE
from optparse import OptionParser
def get_result(p):
stdout = p.communicate()
@trappedinspacetime
trappedinspacetime / build-ubuntu-rootfs.sh
Created June 3, 2019 15:44 — forked from smithclay/build-ubuntu-rootfs.sh
ubuntu bootstrap for user mode linux: minimal
#!/bin/sh
# This script creates a user-mode linux machine based on Ubuntu.
# Created by Clay Smith, May 2017
#
# based on: https://gist.github.com/aputs/6247216
# and https://gist.github.com/AVGP/5410903
set -x
@trappedinspacetime
trappedinspacetime / sync-projects
Created May 22, 2019 14:26 — forked from JonasGroeger/sync-projects
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
NAMESPACE="YOUR_NAMESPACE"
BASE_PATH="https://gitlab.example.com/"
PROJECT_SEARCH_PARAM=""
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")"
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
@trappedinspacetime
trappedinspacetime / memory_layout.md
Created May 20, 2019 21:35 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore