Skip to content

Instantly share code, notes, and snippets.

View dwelch2344's full-sized avatar

David Welch dwelch2344

View GitHub Profile
@dwelch2344
dwelch2344 / encrypt.js
Created October 2, 2017 16:47
Simple encryption using "ursa"
'use strict';
const fs = require('fs')
const ursa = require('ursa')
const home = require('os').homedir()
// if you need one, easy option:
// # openssl rsa -in ~/.ssh/id_rsa -outform pem > ~/.ssh/id_rsa.pem
// # openssl rsa -in ~/.ssh/id_rsa.pem -pubout > ~/.ssh/id_rsa.pub.pem
const pubKey = ursa.createPublicKey(fs.readFileSync(home + '/.ssh/id_rsa.pub.pem'))

Need the transmission_id from the event (easily found both the UI and API) Then just hit https://api.sparkpost.com/api/v1/message-events?transmission_ids=<trans_id> and get the template_id After that, hit https://api.sparkpost.com/api/v1/templates/?transmission_ids= and you're set!

root@29f186d8a68f:/# python3 -m venv /pg_chameleon
root@29f186d8a68f:/# /pg_chameleon/bin/chameleon.py create_schema
Jun 18 02:24:21: [DEBUG] - mysql_lib.py (474): getting table metadata
Jun 18 02:24:21: [INFO] - mysql_lib.py (477): table copy limited to tables: dummy_user
Jun 18 02:24:21: [INFO] - pg_lib.py (583): Installing service schema base
root@29f186d8a68f:/# /pg_chameleon/bin/chameleon.py add_source --config default;
Jun 18 02:24:21: [DEBUG] - mysql_lib.py (474): getting table metadata
Jun 18 02:24:21: [INFO] - mysql_lib.py (477): table copy limited to tables: dummy_user
@dwelch2344
dwelch2344 / jenkins.sh
Last active April 29, 2017 16:32
Jenkins 2.0 pipelines on Ubuntu 16.04
#!/bin/bash
sudo apt-get update
sudo apt-get install -y default-jdk
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
echo 'deb https://pkg.jenkins.io/debian-stable binary/' | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get -y install nginx
$sel = $;
function deleteThem() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($timeout) {
$sel('[aria-label^=" Incoming call from "][aria-label^=" Missed call from "],[aria-label^=" Outgoing call to "]').click();
console.log('selected')
$timeout(() => {
$sel('[aria-label="More options"]').click();
aws_access_key_id: foo
aws_secret_access_key: bar
ssh:
mods:
dev:
user: ubuntu
tunnels:
- 8500:127.0.0.1:8500
- 6002:some.rds.instance:5432
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, ratpack.registry.NotInRegistryException: No object for type 'ratpack.render.Renderer' in registry
at ratpack.guice.internal.RatpackBaseRegistryModule.genericBind(RatpackBaseRegistryModule.java:110) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> ratpack.guice.internal.RatpackBaseRegistryModule)
while locating ratpack.render.Renderer
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at ratpack.registry.internal.CachingBackedRegistry.lambda$transformToInstances$0(CachingBackedRegistry.java:67)
at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
2016-05-16 21:12:42,564 +0000 [docker-init-115534694-1] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->unix://localhost:80
2016-05-16 21:12:42,564 +0000 [docker-init-115534695-1] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.newsclub.net.unix.AFUNIXSocketException) caught when processing request to {}->unix://localhost:80: No such file or directory
2016-05-16 21:12:42,564 +0000 [docker-init-115534695-1] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->unix://localhost:80
2016-05-16 21:12:42,565 +0000 [docker-init-115534694-1] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.newsclub.net.unix.AFUNIXSocketException) caught when processing request to {}->unix://localhost:80: No such file or directory
2016-05-16 21:12:42,565 +0000 [docker-init-115534694-1] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->unix://localhost:80
2016-05-16 21:12:42,565 +0000 [docker-init-115534695-1] INFO org.apache.http
@dwelch2344
dwelch2344 / cmd.sh
Created April 19, 2016 17:13
Example setup to include semver info in MANIFEST.MF
#!/bin/bash
mvn clean package -Dbuild.number=123
// please don't ever do this.
public class ManualDependencyInjectionDemo {
@Getter @Setter
public static class UserService {
public User getUser(String username){
// ...
}
}