Skip to content

Instantly share code, notes, and snippets.

View yadvr's full-sized avatar
💻
cargo b -r

Rohit Yadav yadvr

💻
cargo b -r
View GitHub Profile
@yadvr
yadvr / proxy-notes.txt
Created September 4, 2022 08:50
cloudstack-console-websockets-proxy
# the following can be used to have nginx-proxy/ssl termination on port 8080 for console proxy domain
listen 8080 ssl http2;
location /websockify {
proxy_pass http://192.168.1.42:8080/websockify;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@yadvr
yadvr / ubuntu19.10-kvm-rpi4.txt
Last active March 24, 2021 23:24
Build Ubuntu 19.10 image with KVM for Raspberry Pi 4 ARM64
(Note: tested on Ubuntu 19.10 host/x86_64 machine)
~~
Install dependencies:
apt-get install binutils-aarch64-linux-gnu gcc-9-aarch64-linux-gnu bison flex build-essential kpartx
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev
cd /usr/bin
sudo ln -s aarch64-linux-gnu-gcc-9 aarch64-linux-gnu-gcc
# Build armstubs:
@yadvr
yadvr / patchviasocket.sh
Last active April 12, 2019 18:21
qemu guest agent based patching
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@yadvr
yadvr / patchviasocket.py
Created April 12, 2019 16:18
Patchviasocket via bash
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@yadvr
yadvr / deb-build.sh
Created May 23, 2017 08:26
Debian-pkg recipe for CloudStack
# Using docker container: https://hub.docker.com/r/bhaisaab/ubuntu-cloudstack-slave/
set -e
#apt-get install -y software-properties-common python-software-properties
#add-apt-repository -y ppa:openjdk-r/ppa
#apt-get update -y
#apt-get install -y git debhelper openjdk-7-jdk genisoimage python python-mysql.connector python-mysqldb python-setuptools maven lsb-release dh-systemd sshpass jq curl wget
export ROOT=$PWD
@yadvr
yadvr / README.md
Last active July 5, 2016 10:43
CloudStack Community Analysis

gitlog.sh - gets Apache CloudStack repository and exports git history data to a csv file

download-mboxes.sh - downloads various CloudStack ML archives

parse-mbox-data.sh - parses downloaded mbox archives and exports ML data to a csv file

import fcntl
# Expected output:
# lock acquired
# failed to lock
# lock acquired
lf = '/tmp/some.lock'
h = None

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:

@yadvr
yadvr / test-kvm.sh
Last active March 26, 2016 02:06
Marvin - Test My Cloud
#wip
@yadvr
yadvr / create-rolemaps.py
Last active March 22, 2016 14:10
Dynamic role-based API checker for CloudStack - Migration from old commands.properties file
#!/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]