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

Bash

Moving

command description
ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character
section .text
global _start
_start:
xor eax, eax ; init eax 0
xor ebx, ebx ; init ebx 0
xor esi, esi ; init esi 0
jmp _socket ; jmp to _socket
_socket_call:
@trappedinspacetime
trappedinspacetime / ssdp.py
Created May 23, 2018 17:58 — forked from dankrause/ssdp.py
Tiny python SSDP discovery library with no external dependencies
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@trappedinspacetime
trappedinspacetime / removechars.sql
Created May 12, 2018 17:29 — forked from mitchellhislop/removechars.sql
Removing special characters in MySQL
# FIRST, REPLACE UTF-8 characters.
UPDATE `t` SET `c` = REPLACE(`c`, 0xE28098, "'");
UPDATE `t` SET `c` = REPLACE(`c`, 0xE28099, "'");
UPDATE `t` SET `c` = REPLACE(`c`, 0xE2809C, '"');
UPDATE `t` SET `c` = REPLACE(`c`, 0xE2809D, '"');
UPDATE `t` SET `c` = REPLACE(`c`, 0xE28093, '-');
UPDATE `t` SET `c` = REPLACE(`c`, 0xE28094, '--');
UPDATE `t` SET `c` = REPLACE(`c`, 0xE280A6, '...');
# NEXT, REPLACE their Windows-1252 equivalents.
UPDATE `t` SET `c` = REPLACE(`c`, CHAR(145), "'");
@trappedinspacetime
trappedinspacetime / instructions.markdown
Created March 7, 2018 17:09 — forked from hijonathan/instructions.markdown
Steps to transfer Chrome Custom Search Engines to Alfred

Step 0: Quit Chrome

Step 1: Get a dump of your search engines

> pwd
/Users/jonathankim/Desktop

> sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/Web\ Data
sqlite3> .output chrome_export.sql

sqlite3> .dump keywords

@trappedinspacetime
trappedinspacetime / translate.sh
Created February 24, 2018 15:56
Translate vala project (including appdata.xml and .desktop files) with Gettext and bash script
#!/bin/bash
# Script for easy developing by Carlos Suárez (bitseater@gmail.com) - 2018
# Define variables
PACKAGE="myapplication"
TEMPLATE=po/$PACKAGE.pot
FILES=po/*.po
# Search strings to translate and update po files (mark with _ translatable fields in appdata file)
# p.ex.: <_li>My Application do something</_li><_li>Also do something more</_li>
# Don't use _ to <name> and <summary>.
MYVAR=$(find . -type f -name *vala -or -name *appdata.xml.in -or -name *desktop.in)
@trappedinspacetime
trappedinspacetime / web-servers.md
Created February 11, 2018 12:47 — 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
@trappedinspacetime
trappedinspacetime / build_cross_gcc
Created January 29, 2018 20:00 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /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 / Commands.xml
Created December 14, 2017 17:01 — forked from joshluongo/Commands.xml
Sony BRAVIA KDL-55EX720 Remote Commands
<?xml version="1.0"?>
<remoteCommandList>
<command name="Confirm" type="ircc" value="AAAAAQAAAAEAAABlAw=="/>
<command name="Up" type="ircc" value="AAAAAQAAAAEAAAB0Aw=="/>
<command name="Down" type="ircc" value="AAAAAQAAAAEAAAB1Aw=="/>
<command name="Right" type="ircc" value="AAAAAQAAAAEAAAAzAw=="/>
<command name="Left" type="ircc" value="AAAAAQAAAAEAAAA0Aw=="/>
<command name="Home" type="ircc" value="AAAAAQAAAAEAAABgAw=="/>
<command name="Options" type="ircc" value="AAAAAgAAAJcAAAA2Aw=="/>
<command name="Return" type="ircc" value="AAAAAgAAAJcAAAAjAw=="/>
<?xml version="1.0"?>
<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>AAAAAgAAAJcAAAAZAw==</IRCCCode>
</u:X_SendIRCC>
</s:Body>
</s:Envelope>