Skip to content

Instantly share code, notes, and snippets.

View schmich's full-sized avatar
:octocat:
May all beings be at ease

Chris Schmich schmich

:octocat:
May all beings be at ease
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@schmich
schmich / psiupuxa.rb
Last active February 8, 2022 14:55
Download desktop-resolution wallpapers from http://psiupuxa.com/
# Download desktop-resolution wallpapers from http://psiupuxa.com/
# into the current directory.
require 'nokogiri'
require 'open-uri'
require 'openssl'
require 'uri'
# Disable SSL verification. Ruby SSL cert bundle isn't installed on Windows by default.
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
@schmich
schmich / dw.snippet
Last active July 8, 2022 11:34
Visual Studio snippet to insert Debug.WriteLine with dw
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dw</Title>
<Shortcut>dw</Shortcut>
<Description>Code snippet for Debug.WriteLine</Description>
<Author>Chris Schmich</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@schmich
schmich / dev-setup.sh
Last active March 11, 2016 09:59
Multi-user git webserver deployment
sudo echo 192.168.1.42 webserver >> /etc/hosts
sudo cat >> ~/.ssh/config <<EOF
Host webserver 192.168.1.42
User user1
Hostname webserver
IdentityFile ~/.ssh/id_rsa
EOF
cat ~/.ssh/id_rsa.pub | (ssh user@webserver "mkdir -p .ssh && cat >> ~/.ssh/authorized_keys")
git init project
cd project
@schmich
schmich / signing-git-tags-on-windows.md
Last active May 13, 2016 03:00
Signing git tags on Windows

Signing git tags on Windows

  • Download and install Gpg4win Vanilla (command-line only GPG tools)
  • Create or import an existing key in Windows
    • Create a new key
      • ...
    • Import an existing key
      • On origin system, gpg -a --export-secret-keys you@email.com > secret.key
      • Transfer secret.key to Windows, delete it from origin system
  • On Windows, run gpg --allow-secret-key-import --import secret.key
@schmich
schmich / multi-account-gmail.md
Last active May 9, 2016 21:31
Multi-account Gmail

Multi-account Gmail

Google Apps note

  • If your secondary account is hosted on Google Apps, you might need to allow less secure apps to enable sending and forwarding
  • See details here

Primary account

  • Settings > Accounts and Import > Send mail as > Add another email address you own
@schmich
schmich / config.bat
Last active July 5, 2023 03:36
Forward external connections to Docker on Windows
REM In admin prompt
REM Ensure web server/application is listening on all interfaces (0.0.0.0)
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=10.0.75.2 connectport=80
netsh advfirewall firewall add rule name="App" dir=in action=allow protocol=TCP localport=80 remoteport=80
netsh interface portproxy show v4tov4
netsh advfirewall firewall show rule "App"
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=80
netsh advfirewall firewall del rule name="App"
@schmich
schmich / termbin-encrypted-data.md
Last active April 19, 2024 04:47
Sharing encrypted data via termbin.com with only netcat and OpenSSL

Single file

Source

  • cat /foo/bar/file.txt | openssl enc -aes-256-cbc -base64 | nc termbin.com 9999
  • Enter password twice (quickly), note termbin.com URL

Destination

  • curl -s http://termbin.com/{id} | openssl enc -aes-256-cbc -base64 -d &gt; file.txt