Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.
|
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
| # Run the last command as root | |
| sudo !! | |
| # Serve current directory tree at http://$HOSTNAME:8000/ | |
| python -m SimpleHTTPServer | |
| # Save a file you edited in vim without the needed permissions | |
| :w !sudo tee % | |
| # change to the previous working directory | |
| cd - | |
| # Runs previous command but replacing | |
| ^foo^bar |
| import java.util.concurrent.Callable; | |
| public class Unchecked { | |
| public static <T> T unchecked(Callable<T> callable) { | |
| try { | |
| return callable.call(); | |
| } catch (Exception ex) { | |
| throw new RuntimeException(ex.getMessage(), ex); | |
| } |
|
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.
To get started, install pass and generate a keypair.
$ brew install pass
$ gpg --gen-key
$ gpg --list-keys| #!/bin/sh | |
| [ -n "$(echo $@ | grep "\-debug")" ] && set -x | |
| date=$(date +%Y-%m-%d-T%H-%M-%S) | |
| host=$(cat /proc/sys/kernel/hostname) | |
| backup_dir="/tmp/${host}-${date}" | |
| mkdir -p ${backup_dir} |
| task dependencyReport { | |
| doLast { | |
| def file = new File("project-dependencies.dot") | |
| file.delete() | |
| file << "digraph {\n" | |
| file << "splines=ortho\n" | |
| rootProject.childProjects.each { item -> | |
| def from = item.value | |
| from.configurations.compile.dependencies | |
| .matching { it in ProjectDependency } |
| #!/bin/sh | |
| # Source: https://stackoverflow.com/questions/9683279/make-the-current-commit-the-only-initial-commit-in-a-git-repository/13102849#13102849 | |
| git checkout --orphan newBranch | |
| git add -A # Add all files and commit them | |
| git commit | |
| git branch -D master # Deletes the master branch | |
| git branch -m master # Rename the current branch to master | |
| git push -f origin master # Force push master branch to github |
| [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion | |
| export PATH=$PATH:$HOME/tools/git-tools | |
| export JAVA_HOME=$(/usr/libexec/java_home) | |
| export GREP_OPTIONS='--color=always' | |
| export GREP_COLOR='1;35;40' | |
| export CLICOLOR=1 | |
| alias ll='ls -la' | |
| alias fixcam='sudo pkill "VDCAssistant"' |
| # version #1: enables xtrace if `--debug` argument is supplied | |
| [ -n "$(echo $@ | grep "\--debug")" ] && set -x | |
| # version #2: sets debug variable to 'true' if `--debug` argument is supplied or `xtrace` option is set | |
| debug=false && [ -n "$(echo $@ | grep "\--debug")" ] || [ -n "$(set | grep xtrace)" ] && debug=true |
| import static java.lang.Math.floor; | |
| import static java.util.function.Function.identity; | |
| import static java.util.stream.Collectors.groupingBy; | |
| import static java.util.stream.Collectors.joining; | |
| import static java.util.stream.Collectors.mapping; | |
| import static java.util.stream.Collectors.summingInt; | |
| import static java.util.stream.Collectors.toMap; | |
| import static java.util.stream.IntStream.range; | |
| import java.util.DoubleSummaryStatistics; |