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 / gist:9072b1250b7d2207bb5c
Created Apr 22, 2013
Convert svn repo to git
View gist:9072b1250b7d2207bb5c
- Get authors file:
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
- Fix the authors file with alias = Name <Email@Server.com>
- Convert!
mkdir repo && cd repo
git svn init repo --no-metadata
git config svn.authorsfile <path to authors file>
git svn fetch
@rhtyd
rhtyd / Alcohol Sensor
Created May 3, 2013
Arduino hack @wingify, our resident alcohol breathlyzer
View Alcohol Sensor
int sensorValue;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
sensorValue = analogRead(0); // read analog input pin 0
@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"
@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]
@rhtyd
rhtyd / test-kvm.sh
Last active Mar 26, 2016
Marvin - Test My Cloud
View keybase.md

Keybase proof

I hereby claim:

  • I am rhtyd on github.
  • I am rhtyd (https://keybase.io/rhtyd) on keybase.
  • I have a public key ASBKF-flSK_mbBPGMd3WG_j9wdAixP7jobxQPeZjaWyzIgo

To claim this, I am signing this object:

View fnctl:lockf-vs-flock.py
import fcntl
# Expected output:
# lock acquired
# failed to lock
# lock acquired
lf = '/tmp/some.lock'
h = None
@rhtyd
rhtyd / buildrepo.sh
Last active May 3, 2016
APT/YUM signed repo hosting
View buildrepo.sh
cd /path/to/repo
# rpm
for release in 4.2 4.3 4.4;
do
echo "Buildling repo for $release"
cd $release
rm -fr repodata
createrepo .
@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}
You can’t perform that action at this time.