Skip to content

Instantly share code, notes, and snippets.

View peschee's full-sized avatar
Grabbing another coffee…

Peter Siska peschee

Grabbing another coffee…
View GitHub Profile
@peschee
peschee / multiple-push-urls.md
Created December 12, 2017 12:42 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@peschee
peschee / .gitconfig
Created November 14, 2017 12:39 — forked from bkeepers/.gitconfig
Git aliases to make new commits that fixup or are squashed into previous commits
[alias]
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -
@peschee
peschee / osx_high_sierra.md
Last active October 13, 2017 07:57
MacOS High Sierra Migration Issues
@peschee
peschee / git_ssl_self_signed.md
Last active February 15, 2025 22:18
Disable SSL verification in git repositories with self-signed certificates

Sometimes, we have to access git repositories over SSL and the server only provides a self-signed certificate 🙈. Although there are ways to increase the trust level for the self-signed certificate (https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html, https://confluence.atlassian.com/bitbucketserverkb/resolving-ssl-self-signed-certificate-errors-806029899.html), my recommendation is to just ignore SSL verification alltogether.

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet.

Run git config http.sslVerify false to disable SSL verification if you're working with a checked out repository already.

@peschee
peschee / gist:ff9cf1f0b0adb3cd135dcfd29387b799
Created August 30, 2017 11:17 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@peschee
peschee / ocr.markdown
Created March 26, 2017 14:42 — forked from henrik/ocr.markdown
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

find /the/path -depth -name "*.abc" -exec sh -c 'mv "$1" "${1%.abc}.edefg"' _ {} \;
@peschee
peschee / RevisionsCleanupCommand.php
Created June 24, 2016 07:12 — forked from soerenbernstein/RevisionsCleanupCommand.php
Revisions cleanup for SimpleThings/EntityAudit as symfony command
<?php
/**
* Created by PhpStorm.
* User: Sören Bernstein
* Date: 15.09.2015
* Time: 12:57
*/
namespace Redlink\CASBundle\Command;
@peschee
peschee / java_switch.md
Last active September 30, 2016 08:38 — forked from jvwong/java_switch.md
Switching Java on OSX

List the current installed Java versions

$ /usr/libexec/java_home -V

Install the version desired

Apple provides their own version of 6 (Java for OS X 2015-001)

@peschee
peschee / test-lwp.pl
Created May 31, 2016 13:56
LWP browser test
#!/usr/bin/env perl
# Simple LWP browser for testing
$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("$0/0.1 " . $ua->agent);
# $ua->agent("Mozilla/8.0") # pretend we are very capable browser