Skip to content

Instantly share code, notes, and snippets.

View pingec's full-sized avatar

Matej Drolc pingec

View GitHub Profile
# Instructions
# 1. Start poweshell (v3+) in elevated mode and enter "Set-ExecutionPolicy RemoteSigned"
# 2. Then enter ". { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force"
# 3. Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/pingec/f642deccb6c6d583f478f86518c3ec57/raw -DisableReboots
# 4. Set-ExecutionPolicy Restricted
#### TEMPORARY
Disable-UAC
#### PRIVACY SETTINGS
@pingec
pingec / DumpHttpRequests.cs
Created November 14, 2017 20:35
C# Simple http server to dump requests to console (HttpListener)
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
namespace DumpHttpRequests
{
internal class Program
{
@pingec
pingec / upn_delavska.js
Last active November 15, 2017 15:25
Automatic payment execution on delavska hranilnica online banking platform
windowTrackingInit = (window) => {
window.openedWindows = [];
window._open = window.open;
window.open = function(url,name,params){
var newWindow = window._open(url,name,params);
window.openedWindows.push(newWindow);
windowTrackingInit(newWindow);
}
}
windowTrackingInit(window);
@pingec
pingec / Slovenian.md
Last active November 26, 2017 12:58
Slovenian specifics

ENG - Personal pronouns ENG: I, you, he/she/it, we, you, they

SLO - Osebni zaimki Jaz, ti, on/ona/ono, midva/medve, vidva/vedve, onadva/onidve, mi/me, vi/ve, oni/one/ona

ITA - Pronomi soggetto ITA: Io, tu, lui/lei, noi, voi, loro

ES - Pronombres sujetos

@pingec
pingec / PayPalSaleDemo.cs
Created November 28, 2017 22:34
Quick demo - bare minimum to process a payment through paypal
using PayPal.Api;
using System;
using System.Collections.Generic;
namespace PaypalPayment2
{
/*
Instructions:
1. Install-Package PayPal
2. Set your clientId and clientSecret parameters in GetApiContext()
@pingec
pingec / ipmi_watchdog.ps1
Last active September 27, 2018 16:17
Ipmi watchdog to hard reset machine in case it freezes / crashes
function Get-TimeStamp {
return "[{0:yyyy-MM-dd} {0:HH:mm:ss}]" -f (Get-Date)
}
function Watchdog-Set() {
"$(Get-TimeStamp) Initializing watchdog timer..." >> "$PSScriptRoot\log.txt"
& "$PSScriptRoot\ipmiutil.exe" wdt -a 1 -t 120 -e
}
(install docker)
sudo apt-get install python3.6 python-pip
pip install trezor
git clone https://github.com/pingec/trezor-mcu.git
cd trezor-mcu
./build-firmware.sh master
trezorctl firmware_update -f trezor-master.bin
@pingec
pingec / backup_repos.sh
Created April 12, 2018 09:01
Create gitolite repos snapshots
#!/bin/bash
DATE=$(date +%Y-%m-%d)
DEST_BACKUP_PREFIX="repositories"
BACKUP_NAME="${DEST_BACKUP_PREFIX}_${DATE}.tar"
#echo $DATE $DEST_BACKUP_PREFIX
#echo $BACKUP_NAME
SOURCE="/home/git/repositories"
@pingec
pingec / GetFileProps.ps1
Created November 29, 2018 12:22
Gets detailed file attributes / properties with powershell
Get-ItemProperty .\ApsApfJobWorker.dll | Format-list -Property * -Force
@pingec
pingec / BitstampTransactionsToCsv.js
Created February 11, 2019 11:39
Dumps bitstamp transactions from html table to csv string (including transaction IDs)
/* Dumps bitstamp transactions from html table to csv string (including transaction IDs) */
let bitStampTrxToCsv = () => {
let trxs = $("table.transactions").find("tr");
let csv = "";
for (let i = 0; i < trxs.length - 1; i++) {
if (trxs.eq(i).is(".details")) {