Skip to content

Instantly share code, notes, and snippets.

View ashee's full-sized avatar

Amitava Shee ashee

View GitHub Profile
@ashee
ashee / register-jdbc-drivers.cli
Created May 4, 2016 14:35 — forked from ehsanullahjan/register-jdbc-drivers.cli
Snippets for enabling JDBC drivers, deployed as modules, in JBoss / Wildfly using JBoss CLI
# PostgreSQL
/subsystem=datasources/jdbc-driver=postgres:add(driver-name=postgres,jdbc-compliant=true,driver-module-name=org.postgres.jdbc,driver-class-name=org.postgresql.Driver,driver-datasource-class-name=org.postgresql.ds.PGPoolingDataSource,xa-datasource-class=org.postgresql.xa.PGXADataSource)
# SQL Server
/subsystem=datasources/jdbc-driver=sqlserver:add(driver-name=sqlserver,jdbc-compliant=true,driver-module-name=org.jtds.jdbc,driver-class-name=net.sourceforge.jtds.jdbc.Driver,driver-datasource-class-name=net.sourceforge.jtds.jdbcx.JtdsDataSource,xa-datasource-class=net.sourceforge.jtds.jdbcx.JtdsDataSource)
# Oracle
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,jdbc-compliant=true,driver-module-name=com.oracle.jdbc,driver-class-name=oracle.jdbc.OracleDriver,driver-datasource-class-name=oracle.jdbc.pool.OracleDataSource,xa-datasource-class=oracle.jdbc.xa.OracleXADataSource)
# MySQL
@ashee
ashee / GIF-Screencast-OSX.md
Created April 17, 2016 20:35 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ashee
ashee / bootstrapCDN.html
Last active December 16, 2015 11:39 — forked from planetoftheweb/bootstrapCDN.html
Bootstrap 3 CDN Page Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<!-- IE Edge Meta Tag -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Viewport -->
@ashee
ashee / mac-oui.text
Last active October 31, 2024 20:54
Common mac address prefix/oui
QEMU - 52:54:00
VMWare - 00:50:56
Xen Source - 00:16:3E
Xen - 00:ca:fe
Microsoft - 00:15:5D
@ashee
ashee / decrypt.java
Created September 28, 2015 20:05
jboss - decrypt vault password
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
# ==============================================================
# 10.10 How to make an ISO from the Install.app
# ==============================================================
# Mount the installer image. It assumes that the installation app is called "Install OS X Yosemite.app"
# located in your "Applications" folder. If not, change the first command accordingly.
# you are expected to prepare /System/Library/Kernels/kernel at this stage
# kernel can be extracted from InstallESD.dmg/Packages/Essentials.pkg/System/Library/Kernels/kernel with Pacifist
PATH_TO_KERNEL=kernel
@ashee
ashee / simplevpn
Last active September 11, 2015 06:58 — forked from vi/simplevpn
simplevpn: Simple IPsec and ipip[6] tunnel configuration for Linux using SSH for key exchange
#!/bin/bash
# Setup encrypted IPv4 tunnel over IPv4 or IPv6 on two Linux nodes using SSH for tunnel setup.
# Requires only ipsec-tools, iproute2, ssh and necessry kernel modules locally and remotely.
# Warning: it flushes IPsec settings both locally and remotely.
# Don't use with other IPsec tunnnels.
# Sample usage:
# simplevpn -6 fc::1 fc::2 ssh -T root@fc::2
@ashee
ashee / burn-iso-dvd.sh
Last active June 27, 2023 04:59
Burn iso to dvd from CLI on CentOS 7
# install dvd+rw-tools
$ sudo yum install dvd+rw-tools
$ sudo growisofs -speed=1 -dvd-compat -Z /dev/sr0=/home/amitava/dl/CentOS-7-x86_64-DVD-1503-01.iso
@ashee
ashee / tcdpump-arp.sh
Created September 7, 2015 13:22
tcpdump - arp and icmp
# tcpdump -eni br0 '(icmp or arp) and host 10.0.2.14'
@ashee
ashee / rhel7-ovsbr0.md
Last active August 29, 2015 14:27
RHEL 7 ovs bridge setup

See openvwitch source rhel/README.RHEL

[root@localhost network-scripts]# vi ifcfg-ovsbr0 
DEVICE=br0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
OVSBOOTPROTO=dhcp
OVSDHCPINTERFACES=enp0s3
HOTPLUG=no