Skip to content

Instantly share code, notes, and snippets.

View gavvvr's full-sized avatar
🥷
Taming complexity

Kirill Gavrilov gavvvr

🥷
Taming complexity
View GitHub Profile
@stigkj
stigkj / git-fix-author
Created December 9, 2011 11:13 — forked from leif81/git_fix_author
Written to change the unix name used for a cvs commit to a pretty git name for the user.Implementation borrowed from http://lists.freedesktop.org/archives/portland/2010-October.txtauthor-conv-file format (same format as git-cvsimport requires):
#!/bin/bash
#
# Changes author and committer name and email throughout the whole repository.
# Uses a file with the following format:
#
# john.doe@hotmail.com=John Doe <john.doe@hotmail.com>
# jill.doe@hotmail.com=Jill Doe <jill.doe@hotmail.com>
#
if [ ! -e "$1" ]
@albertoaflores
albertoaflores / .mavenrc
Created July 3, 2012 12:27
Sample .mavenrc file for SSL connections
MAVEN_OPTS="-Djavax.net.ssl.keyStore=<YOU KEYSTORE FILE> \
-Djavax.net.ssl.keyStorePassword=<YOUR KEYSTORE PASSWORD> \
-Djavax.net.ssl.keyStoreType=JKS \
-Djavax.net.ssl.trustStore=<YOUR TRUSTSTORE FILE> \
-Djavax.net.ssl.trustStorePassword=<YOUR TRUSTSTORE PASSWORD> \
-Djavax.net.ssl.trustStoreType=JKS"
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@mislav
mislav / _readme.md
Last active May 15, 2024 11:03
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@js1972
js1972 / write_file.groovy
Created May 16, 2014 07:42
How to write content to a new file (overwrite if already existing) in Groovy.
//
// Write the mock request payload to a file for checking later...
// newWrite() is the important it to ensure you get a *new* file each time.
//
def filename = "C:\\MyScratchFolder\\soapUI projects\\Testing\\procon\\mock_po_activity_request.xml"
def file = new File(filename)
def w = file.newWriter()
w << mockRequest.requestContent
w.close()
@abn
abn / heredoc-dockerfile.snip
Last active June 16, 2024 22:01
Dockerfile alternatives for heredoc
#printf
RUN printf '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
>> /tmp/hello
#echo
RUN echo -e '#!/bin/bash\n\
echo hello world from line 1\n\
echo hello world from line 2'\
@robvalk
robvalk / UserACLExtractor.java
Last active October 29, 2019 15:22
LDAP Security in Mule
import org.mule.api.MuleEventContext;
import org.mule.api.lifecycle.Callable;
import org.mule.api.transport.PropertyScope;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.ldap.userdetails.LdapUserDetailsImpl;
public class UserACLExtractor implements Callable {
private static final Logger log = LoggerFactory.getLogger(UserACLExtractor.class);
# On OSX, install brew for all the things
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Brew Caskroom
brew install caskroom/cask/brew-cask
# Install Google Cloud SDK
brew cask install google-cloud-sdk
# After installing, follow the printed instructions to add the paths
@DavideMontersino
DavideMontersino / private-fork.md
Last active February 27, 2024 12:56
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab

@oznu
oznu / README.md
Last active June 9, 2024 16:57
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements