Skip to content

Instantly share code, notes, and snippets.

View the-ress's full-sized avatar

Tereza Tomcova the-ress

  • Prague, Czech Republic
View GitHub Profile
@jstangroome
jstangroome / gist:3087453
Created July 11, 2012 01:58
Change your own Active Directory password from PowerShell without any special permissions
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword')
@willurd
willurd / web-servers.md
Last active July 19, 2024 02:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ronnieoverby
ronnieoverby / App.xaml.cs
Last active September 16, 2023 12:08
wpf global exception handling
// somewhere early in App.xaml.cs
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
LogUnhandledException((Exception) e.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException");
DispatcherUnhandledException += (s, e) =>
LogUnhandledException(e.Exception, "Application.Current.DispatcherUnhandledException");
TaskScheduler.UnobservedTaskException += (s, e) =>
LogUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException");
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@zkiraly
zkiraly / procedure-to-archive-git-branches.md
Last active June 12, 2024 12:03
Procedure to archive git branches.
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@teamaton
teamaton / disable-fusion-log.ps1
Last active November 6, 2023 12:53
FusionLog - enable and disable
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name ForceLog
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogFailures
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogResourceBinds
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogPath
@david-risney
david-risney / JavaScriptDataBreakpoint.js
Created June 15, 2016 17:45
JavaScript data breakpoint
function ValueBreakpoint(parent, fullNamePath) {
var name = fullNamePath[0];
var childNamePath = fullNamePath.slice(1);
var innerValue = parent[name];
var childBreakpoints = [];
function applyChildValueBreakpoints() {
if (childNamePath.length > 0 && innerValue) {
childBreakpoints.push(new ValueBreakpoint(innerValue, childNamePath));
}
@jaywilliams
jaywilliams / install-mosh.sh
Last active January 3, 2024 17:16 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2024)
#!/usr/bin/env bash
set -e
# Dreamhost Mosh Install Script
# Jay Williams (https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5)
# Based on the gracious work of:
# Paul R Alexander (https://gist.github.com/palexander/2975305)
# Sami Samhuri https://gist.github.com/samsonjs/4076746
@troyfontaine
troyfontaine / README.md
Last active October 15, 2023 09:58
Ubiquiti USG config.gateway.json Syntax

Ubiquiti USG Advanced Configuration

Overview

Integrated DNS Overview

When using a USG with Ubiquiti's Unifi Controller software (version 5.6 and earlier), the functionality of integrating the hostnames of clients (when they request a DHCP lease) into local DNS does not appear to work as you would find with Consumer grade routers. To work around this limitation, we can add static host mappings to a configuration file that will be provisioned to the USG when either a configuration change is made or we force provisioning to the USG itself.

Non-GUI Supported Dynamic DNS Providers

I've added in the necessary syntax for adding Cloudflare DDNS to the USG for VPN/Services setup courtesy of this post by britannic on the Ubiquiti Forums.

Configuration File