Skip to content

Instantly share code, notes, and snippets.

@ukdave
ukdave / RSA.java
Created March 19, 2017 17:32
Java RSA
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import static java.math.BigInteger.ONE;
public class RSA {
public static void main(String[] args) {
// https://simple.wikipedia.org/wiki/RSA_(algorithm)
@ukdave
ukdave / atom-plugins.txt
Last active September 8, 2017 07:40
apm list --installed --bare
activate-power-mode@2.4.0
atom-beautify@0.30.5
autoclose-html@0.23.0
autocomplete-ruby@0.2.8
busy-signal@1.4.3
change-case@0.6.5
color-picker@2.2.5
dash@1.7.1
emmet@2.4.3
file-icons@2.1.11
@ukdave
ukdave / .zshrc
Last active September 14, 2017 08:03
# Path to your oh-my-zsh installation.
export ZSH=/Users/david/.oh-my-zsh
POWERLEVEL9K_MODE="nerdfont-complete"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs time)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
#!/bin/sh
set -e
txtend=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
txtred=$(tput setaf 1) # Red
txtgrn=$(tput setaf 2) # Green
txtylw=$(tput setaf 3) # Yellow
txtblu=$(tput setaf 4) # Blue
buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
repoConfig = {
maven { url 'http://localhost:8081/nexus/content/repositories/public' }
}
}
repositories repoConfig
@ukdave
ukdave / exiftool-geotag.sh
Last active February 8, 2016 22:22
Add geotags to photos from a set of GPX files
exiftool \
-api GeoMaxIntSecs=60 -api GeoMaxExtSecs=60 \
-geotag="track1.gpx" \
-geotag="track2.gpx" \
-P .
exiftool \
-api GeoMaxIntSecs=600 -api GeoMaxExtSecs=600 \
-geotag="track1.gpx" \
-geotag="track2.gpx" \
@ukdave
ukdave / 01-gulpfile.js
Last active May 10, 2016 19:58
Gulp script to process stylesheets using sass, and Javascript using babel, concat, and uglify, and use browsersync for development with live-reloading
const gulp = require('gulp'),
gutil = require('gulp-util'),
eslint = require('gulp-eslint'),
sass = require('gulp-sass'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'),
stylelint = require('gulp-stylelint')
babel = require('gulp-babel'),
concat = require('gulp-concat'),
ngAnnotate = require('gulp-ng-annotate'),
#!/bin/bash
NEXUS_STORAGE_DIR=/opt/sonatype-work/nexus/storage
DIFF_DIR=/home/console/nexus-diffs
TSTAMP=`date +"%Y-%m-%d_%H-%M"`
if [ ! -f ${DIFF_DIR}/filelist_latest.txt ]; then
touch ${DIFF_DIR}/filelist_0000-00-00_00-00.txt
ln -s ${DIFF_DIR}/filelist_0000-00-00_00-00.txt ${DIFF_DIR}/filelist_latest.txt
fi
@ukdave
ukdave / gulpfile.js
Created November 24, 2015 22:05
Browsersync with proxy for Spring Boot REST API
var gulp = require('gulp');
var proxyMiddleware = require('http-proxy-middleware');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
port: 9000,
server: "./app"
@ukdave
ukdave / watchdog.cron
Created April 20, 2015 07:31
Generic watchdog script
* * * * * root /usr/local/bin/foo-watchdog.sh