Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Austen djangofan

View GitHub Profile
View Bitcoin CLI Practice
These instructions require that you have Docker properly setup on your Windows computer:
docker volume create portainer_data
docker run -d -p 3040:9000 --name portainer --restart=always -v portainer_data:/data portainer/portainer --no-auth -H tcp://host.docker.internal:2375
docker volume create --name=bitcoind-data
docker run -v bitcoind-data:/bitcoin --name=bitcoind-node -d -p 18444:18444 -p 127.0.0.1:18332:18332 bitcoindevelopernetwork/bitcoind-regtest
then, open Portainer on localhost:3040
then, open the console to write commmands
View keybase.md

Keybase proof

I hereby claim:

  • I am djangofan on github.
  • I am djangofan (https://keybase.io/djangofan) on keybase.
  • I have a public key ASBhRXM__QMBKBSS6qRsTKTVbYrZOoZlIBZuqDHklasJLQo

To claim this, I am signing this object:

@djangofan
djangofan / instructions_ibm_mq_server.txt
Last active Jul 30, 2020
IBM MQ 9.1 server in 5 minutes...
View instructions_ibm_mq_server.txt
#!/bin/bash
# https://github.com/ibm-messaging/mq-container/blob/master/docs/usage.md
# https://github.com/ibm-messaging/mq-container/blob/master/docs/developer-config.md
## https://www.blazemeter.com/blog/ibm-mq-testing-with-jmeter-learn-how
# https://localhost:9009/ibmmq/console
## User: admin
## Password: passw0rd
# http://localhost:9157/metrics
# Version found at: https://hub.docker.com/_/ibm-mq-advanced -- 9.1.2.0
View small_taxi.csv
vendor_id pickup_datetime dropoff_datetime passenger_count trip_distance pickup_longitude pickup_latitude rate_code store_and_fwd_flag dropoff_longitude dropoff_latitude payment_type fare_amount extra mta_tax tip_amount tolls_amount imp_surcharge total_amount pickup_location_id dropoff_location_id
2 2017-09-23 05:08:42 2017-09-23 05:27:39 6 9.38 1 N 1 27.5 0.5 0.5 3.5 0 0.3 32.3 87 41
1 2017-07-14 19:07:38 2017-07-14 19:54:17 1 9.7 1 N 1 36 1 0.5 7.55 0 0.3 45.35 162 188
2 2017-10-29 00:42:06 2017-10-29 00:43:12 2 0.09 1 N 3 -3 -0.5 -0.5 0 0 -0.3 -4.3 164 164
2 2017-10-02 20:38:17 2017-10-02 21:13:09 1 12.4 1 N 1 38 0.5 0.5 7.86 0 0.3 47.16 48 130
1 2017-05-11 22:53:11 2017-05-11 23:27:53 2 7.9 1 N 1 29.5 0.5 0.5 6.15 0 0.3 36.95 163 25
@djangofan
djangofan / JedisServiceImpl.java
Created Oct 8, 2018
Example of JedisServiceImpl class in Java.
View JedisServiceImpl.java
package com.tb.services;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@djangofan
djangofan / .bash_profile.sub.sh
Last active Sep 1, 2018
LIB SETUP IN OSX MAC .bash_profile
View .bash_profile.sub.sh
# put in .bash_profile
export PATH=".:/usr/local/bin:/usr/local:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/sw/bin:$PATH"
export PATH="$PATH:/usr/local/git/bin"
export PATH="$PATH:$HOME/.pyenv/shims" # add Python version manager 'brew install pyenv'
eval "$(pyenv init -)"
echo "Python shimmed: " + $(pyenv which python)
export PATH="$PATH:$HOME/.rbenv/bin" # add Ruby version manager 'brew install rbenv'
eval "$(rbenv init -)"
echo "Ruby shimmed: " + $(rbenv which ruby)
# install SDKMAN 'curl -s "https://get.sdkman.io" | bash'
@djangofan
djangofan / QueryManager.java
Created Jul 19, 2018
An example of QueryManager in Java for JPA
View QueryManager.java
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.HashMap;
import java.util.Map;
public class QueryBuilder {
private final EntityManager entityManager;
private final Map<String, Object> parameters = new HashMap<>();
private String resultSetMapping;
private String query;
@djangofan
djangofan / Dockerfile
Created Jul 19, 2018
Install AWS CLI on docker container
View Dockerfile
FROM tomcat:8.5-jre8-alpine
#Metadata
LABEL version="1.0-SNAPSHOT"
LABEL description="Run ss a service"
#Install AWS CLI
RUN apk update && \
apk add --no-cache python tar && \
python -m ensurepip && \
@djangofan
djangofan / Tracert.java
Last active Jun 1, 2022
Traceroute in Java
View Tracert.java
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.Arrays;
import jpcap.JpcapCaptor;
import jpcap.JpcapSender;
@djangofan
djangofan / socat-config.sh
Last active Dec 27, 2021
socat daemon on OSX for Docker
View socat-config.sh
#!/bin/bash
#brew install socat
# socat TCP-LISTEN:2377,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
#file: docker.socat_listener
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
# <plist version="1.0">
# <dict>