Skip to content

Instantly share code, notes, and snippets.

View matthiasbalke's full-sized avatar

Matthias Balke matthiasbalke

  • Germany
View GitHub Profile
@matthiasbalke
matthiasbalke / extract-git-path.sh
Created February 23, 2018 13:14
extract a specific path from git repository with history
#!/bin/bash
git clone https://example.com/repo
# change into repository dir
cd repo
git checkout --detach
# delete all local branches
@matthiasbalke
matthiasbalke / top-10-git-objects.sh
Created February 23, 2018 13:11
list largest 10 commits in a git repostiory
#!/bin/bash
# execute inside repostiory directory
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"
@matthiasbalke
matthiasbalke / loadSshKey.sh
Last active January 25, 2018 19:40
add ssh key to Mac OS X keychain
#/bin/bash
ssh-add -K ~/.ssh/myKey
@matthiasbalke
matthiasbalke / octal_permissions.sh
Created November 20, 2017 12:52
get octal permissions for file
#!/bin/bash
# https://askubuntu.com/a/152003/115020
stat -c "%a %n" <filename>
@matthiasbalke
matthiasbalke / maven_version.sh
Created November 7, 2017 11:17
Maven get project version to file
# https://stackoverflow.com/questions/3545292/how-to-get-maven-project-version-to-the-bash-command-line
mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }' > version
@matthiasbalke
matthiasbalke / git_set_executable.sh
Last active June 18, 2018 07:30
Set executable permissions using git
#!/bin/bash
# set executable
git update-index --chmod=+x myScript.sh
# check permissions
git ls-files -s myScript.sh
@matthiasbalke
matthiasbalke / print-x509-certificate.sh
Created September 22, 2017 07:59
print x509 certificate
#!/bin/bash
openssl x509 -in server-cert.crt -text|more
@matthiasbalke
matthiasbalke / allDependencies.gradle
Created July 26, 2017 09:10
List all Gradle Dependencies
/**
* List all Dependencies of main / subprojects for given configurations.
*/
task allDependencies {
doLast {
// only check defined configurations
def includedConfigurations = ['compile', 'testCompile', 'runtime']
def deps = [:]
@matthiasbalke
matthiasbalke / docker-rm-grep.sh
Created June 2, 2017 13:59
Delete docker container by grepping through docker ps -a
#!/bin/sh
GREP=lead
docker rm $(docker ps -a | grep $GREP | cut -d ' ' -f 1)
@matthiasbalke
matthiasbalke / README.md
Created April 11, 2017 08:29
Speedup Atom startup

Source

atom/atom#4293

What It Is

It delay the config file load, and the packages load and active, which cost much time on start. After change, atom only load and active the must packages on start, which is ui theme、syntax theme、tabs、status-bar、tree-view. Then delay to load and active other package. Window and mainly package will show quickly.

How To Do: