Skip to content

Instantly share code, notes, and snippets.

View linktohack's full-sized avatar

Quang-Linh LE linktohack

View GitHub Profile
@linktohack
linktohack / metaview.py
Last active March 3, 2016 11:40
MITM rule for bigger screen
# Usage: mitmdump -s "modify_response_body.py mitmproxy bananas"
# (this script works best with --anticache)
from libmproxy.models import decoded
script = '''
<script type="text/javascript">
(function() {
var width = 400;
big();
@linktohack
linktohack / real-click.js
Last active April 14, 2016 23:43
selenium real click via xdotool
var Promise = require('bluebird'),
child_process = require('child_process')
exec = Promise.promisify(child_process.exec);
realClick(driver, "document.querySelectorAll('.srg > div:nth-child(3) > div:nth-child(1) > h3:nth-child(1) > a:nth-child(1)')[0]");
function realClick(driver, element) {
return driver.executeScript("\
document.myNamespace = {};\
document.myNamespace.mousePositionHandler = function (e) {\
@linktohack
linktohack / index.php
Created June 20, 2016 07:20
Adminer 4.2.5 loader without password for SQLite
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
return true;
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";
@linktohack
linktohack / nfc.js
Last active February 6, 2017 15:01
NFC
var nfc = require('nfc').nfc;
var util = require('util');
var Badge = {
logging: true,
read: function(callback) {
var Badge = this;
var i = 0;
Badge.logging && console.log('nfc.version(): ' + util.inspect(nfc.version(), { depth: null }));
@linktohack
linktohack / cask-outdated.sh
Created November 1, 2016 12:33
Oudated Cask (-q + grep to script)
function cask-outdated() {
local INFO
local OUTDATED
local LATEST
local c
local available
local installed
for c in $(brew cask list); do
INFO=$(cask info $c 2>&1)
FROM resin/%%RESIN_MACHINE_NAME%%-node
ENV DEBIAN_FRONTEND noninteractive
# Instal MySQL Server
RUN echo mysql-server mysql-server/root_password password root | debconf-set-selections;\
echo mysql-server mysql-server/root_password_again password root | debconf-set-selections;
RUN apt-get update && apt-get install -yq mysql-server mysql-client libmysqlclient-dev
RUN sed -i -e "s@^datadir.*@datadir = /data/mysql@" /etc/mysql/my.cnf
@linktohack
linktohack / magasin.js
Created December 29, 2016 16:41
Barcode generator
var blocks = magasins.map(m => {
var block = $(`
<div class="block" style="display: inline-block; border: 2px dotted grey; margin: 10px; border-radius: 5px;">
<p>${m.name}</p>
<img id=DB${m.pano} style="width: 200px">
</div>
`);
return block;
});
@linktohack
linktohack / Dockerfile
Created January 23, 2017 00:30
Firefox in Docker
FROM ubuntu:16.04
MAINTAINER linktohack@gmail.com
RUN apt-get update && \
apt-get install -y x11vnc xvfb dwm firefox && \
rm -rf /var/lib/apt/lists/*
RUN mkdir ~/.vnc && \
x11vnc -storepasswd 1234 ~/.vnc/passwd && \
bash -c 'echo "#!/bin/bash" > /entrypoint.sh' && \
bash -c 'echo "Xvfb :0 -screen 0 1024x768x16 &" >> /entrypoint.sh' && \
bash -c 'echo "sleep 1" >> /entrypoint.sh' && \
@linktohack
linktohack / patch.sh
Last active February 6, 2017 15:01
Scarmark Patch
#!/bin/bash
cat > "$HOME/main.html" <<'EOF'
<style>
.magasin-lot-info {
font-family: monospace;
font-size: 8px;
color: white;
padding: 8px;
}
</style>
@linktohack
linktohack / drop-link.js
Created February 7, 2017 17:37
Remove all Dropbox Links