Skip to content

Instantly share code, notes, and snippets.

🐵
Busy

Rohit Yadav rhtyd

🐵
Busy
Block or report user

Report or block rhtyd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
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 / 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 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');
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
@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)
@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 / 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 / test-diff
Created Mar 5, 2016
Nux - vms on dashboard
View test-diff
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 22f7409..e91b349 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -4479,6 +4479,7 @@ textarea {
height: 316px;
overflow: auto;
overflow-x: hidden;
+ overflow-y: auto;
/*+placement:shift 0px 0px;*/
@rhtyd
rhtyd / create-rolemaps.py
Last active Mar 22, 2016
Dynamic role-based API checker for CloudStack - Migration from old commands.properties file
View create-rolemaps.py
#!/bin/env python
# Usage: python <script> <commands.properties file>
import sys
import uuid
def createMappings(apis):
# All apis allowed for root Admin
print("INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`) values (UUID(), 1, '*', 'Allow')")
# ResourceAdmin, DomainAdmin, User
roles = [2, 3, 4]
You can’t perform that action at this time.