Skip to content

Instantly share code, notes, and snippets.

View pingec's full-sized avatar

Matej Drolc pingec

View GitHub Profile
@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 / 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"
(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 / 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
}
@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 / 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 / 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 / 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
{
# 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 / sendtemp.sh
Last active March 22, 2017 19:52
Reporting temperatures from openwrt router
#!/bin/sh
# Gets temperature from 1wire sensor with specified address and posts it to specified url (teste on openwrt@wr1043nd)
SENSR_ADDR="28DD70770200009C"
SENSR_NUM=$(/usr/bin/digitemp_DS9097 -s /dev/ttyUSB0 -i -q | grep $SENSR_ADDR | grep ROM | cut -c6)
TEMP=$(/usr/bin/digitemp_DS9097 -t$SENSR_NUM -q -o"%.2C")