Skip to content

Instantly share code, notes, and snippets.

Avatar
🐵
Busy

Rohit Yadav rhtyd

🐵
Busy
View GitHub Profile
@rhtyd
rhtyd / updateddns
Created Jan 9, 2016
CloudFlare DDNS
View updateddns
cfuser=you@email.com
cfkey=cf-key-here
zoneid=some-zoneid
dnsrec=dns-record-id
domain=somedomain.com
curl -X PUT "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records/$dnsrec" \
-H "X-Auth-Email: $cfuser" \
-H "X-Auth-Key: $cfkey" \
-H "Content-Type: application/json" \
@rhtyd
rhtyd / Crack2.java
Created Nov 1, 2015
CloudStack Encryption key retriever
View Crack2.java
import java.util.*;
import java.util.logging.*;
import java.io.*;
import java.lang.Math.*;
import java.nio.charset.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.BlockingQueue;
@rhtyd
rhtyd / ListCiphers.java
Last active Oct 16, 2015
Lists available ciphers in jdk
View ListCiphers.java
import java.security.KeyStore;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManagerFactory;
public class ListCiphers
{
public static void main(String[] args)
View updateddns.sh
#!/bin/bash
set -x
IP=$(wget -qO- http://ipecho.net/plain; echo)
wget -qO- http://username:password@dynupdate.no-ip.com/nic/update?hostname=fqdn.host.name&myip=$IP &> /dev/null
View cloudstack-db-mock-upgrade.sql
USE `cloud`;
INSERT into `cloud`.`vm_template` (unique_name, name, uuid, hvm, hypervisor_type) values ('systemvm-xenserver-4.5-fake-uuid', 'systemvm-xenserver-4.5', 'fakeduuidkvm1', 0, 'KVM');
INSERT into `cloud`.`vm_template` (unique_name, name, uuid, hvm, hypervisor_type) values ('systemvm-vmware-4.5-fake-uuid', 'systemvm-vmware-4.5', 'fakeduuidvmware1', 0, 'VMware');
@rhtyd
rhtyd / my.cnf
Created Jul 27, 2015
Example MySQL my.cnf optimized
View my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
syslog
View deepcopy-vs-list.py
import copy
a = 1
b = [1,2,3]
c = "Some random string :)"
z = [a,b,c]
x = list(z)
x[1][1] = 100
@rhtyd
rhtyd / vnc-decrypt.sh
Created May 29, 2015
vnc-decrypt: CloudStack VNC Password decryption tool
View vnc-decrypt.sh
#!/bin/bash
input=$(mysql -u root -proot -e "select vnc_password from cloud.vm_instance where name='$1'\G;" | grep vnc_password | sed 's/.*vnc_password: //')
java -classpath /usr/share/cloudstack-common/lib/jasypt-1.9.0.jar org.jasypt.intf.cli.JasyptPBEStringDecryptionCLI decrypt.sh input=$input password=password verbose=true
@rhtyd
rhtyd / rpm-centos6-build.sh
Last active May 11, 2016
Building CloudStack Packages
View rpm-centos6-build.sh
set -e
export ROOT=$PWD
git fetch origin
git clean -fdx
rm -fr deps/*jar deps/awsapi-lib deps/*.mar NONOSS
git checkout -- .
git checkout ${TAG}
export MINOR=${BUILD_ID}
@rhtyd
rhtyd / build-systemvm-vmware-ovftool.sh
Created May 12, 2015
build-systemvm-vmware-ovftool
View build-systemvm-vmware-ovftool.sh
#!/bin/bash
# usage: bash <script> systemvm64template-4.5-vmware systemvm64template-4.5-vmware.vmdk
function stage_vmx (){
cat << VMXFILE > "${1}.vmx"
.encoding = "UTF-8"
displayname = "${1}"
annotation = "${1}"
guestos = "otherlinux-64"