Skip to content

Instantly share code, notes, and snippets.

View jpluimers's full-sized avatar

Jeroen Wiert Pluimers jpluimers

  • wiert.me
  • Amsterdam, The Netherlands
View GitHub Profile
@jpluimers
jpluimers / gist_search.rb
Created October 19, 2017 09:30 — forked from henrik/gist_search.rb
Search your own public Gists from the command line. Because the site only provides global search. There's not yet an API for private Gists.
require "open-uri"
require "rubygems"
require "json"
USERNAME = "henrik"
query = ARGV.first.downcase
gists = JSON.parse(open("http://gist.github.com/api/v1/json/gists/#{USERNAME}").read)['gists']
Add-Type -TypeDefinition @"
public enum AggregationType
{
Min,
Max,
Sum,
Avg
}
"@
@jpluimers
jpluimers / InsertTabsOrSpaces-vc2010macro.vb
Created October 26, 2017 09:19 — forked from dadhi/InsertTabsOrSpaces-vc2010macro.vb
Visual Studio 2010 macros to set "Insert spaces" or "Keep tabs" in Tools -> Options -> Text Editor -> C# -> Tabs page. Thanks to answer http://stackoverflow.com/a/1721896/2492669. For those who switching between solutions with spaces and tabs. As for me, I have assigned macros on ctrl+shift+alt+s and ctrl+shift+alt+t and quite happy now.
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
# DISCLAIMER: No warranty. Please read this script carefully before running and use at your own risk!
# Clears gsScrollPos cookies from chrome as temporary workaround for https://github.com/deanoemcke/thegreatsuspender/issues/537
# PSSQLite module required: https://www.powershellgallery.com/packages/PSSQLite/ - https://github.com/RamblingCookieMonster/PSSQLite
# WARNING: This WILL close any running chrome processes. This script will also need to be run as administrator to stop the chrome processes.
Import-Module PSSQLite
$null = Get-Process 'chrome' -ErrorAction SilentlyContinue | %{$_.CloseMainWindow()}
$DataSource = '~\AppData\Local\Google\Chrome\User Data\Default\Cookies'
$Query = "delete from cookies where name like 'gsScrollPos-%'"
@jpluimers
jpluimers / Install Signal Desktop as a standalone app.md
Created November 8, 2017 08:20 — forked from shvchk/Install Signal Desktop as a standalone app.md
Deprecated, please use official standalone Signal Desktop: https://signal.org
unit NonBlockingDlgHelperU;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
const
WM_ShowDlgA = WM_APP + 1;
@jpluimers
jpluimers / Enum.Wrapper.pas
Created December 28, 2017 09:22 — forked from ortuagustin/Enum.Wrapper.pas
Enum.Wrapper.pas
unit Enum.Wrapper;
interface
uses
System.SysUtils,
System.TypInfo;
type
EEnumOutOfRange = class(System.SysUtils.EArgumentOutOfRangeException);
@jpluimers
jpluimers / get_dns_records.py
Created March 1, 2018 12:53 — forked from akshaybabloo/get_dns_records.py
Printing all DNS records using DNSPython in Python 3
#!/usr/bin/env python
# -*- coding utf-8 -*-
#
# Copyright 2016 Akshay Raj Gollahalli
import dns.resolver
def get_records(domain):
"""
@jpluimers
jpluimers / README-setup-tunnel-as-systemd-service.md
Created March 9, 2018 22:35 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@jpluimers
jpluimers / autossh.service
Created March 9, 2018 22:35 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)