Skip to content

Instantly share code, notes, and snippets.

View shakirshakiel's full-sized avatar

Shakir Shakiel shakirshakiel

  • Thoughtworks
  • Chennai
View GitHub Profile
{
"Timestamp": "2021-07-10T13:05:41Z",
"Go Server Information": {
"Version": "21.3.0 (12570-be7a761d08f0c6c7da20076c86e4dcc473075416)"
},
"Config Statistics": {
"Valid Config": {
"Number of pipelines": 2,
"Number of environments": 10,
{
"Timestamp": "2020-11-15T15:51:35Z",
"Go Server Information": {
"Version": "20.7.0 (12097-f4f86ca8d433edaf9235ed92790c11e19d7be4ed)"
},
"Config Statistics": {
"Valid Config": {
"Number of pipelines": 0,
"Number of environments": 12,
"Number of agents": 1,
version: '3.1'
services:
db:
image: shakirshakiel/mypostgres:latest
restart: always
environment:
POSTGRES_PASSWORD: password
volumes:
FROM postgres:12.4
RUN apt-get update -y && apt-get install -y htop build-essential procps
package main
import (
"github.com/gin-gonic/gin"
"fmt"
"github.com/prometheus/client_golang/prometheus"
"net/http"
"time"
"io/ioutil"
"github.com/sirupsen/logrus"
[Unit]
Description=go-server
After=syslog.target
[Service]
Type=forking
ExecStart=/usr/share/go-server/bin/go-server start sysd
ExecStop=/usr/share/go-server/bin/go-server stop sysd
User=go
KillMode=control-group
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: goserver-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: k8s-master
http:
@shakirshakiel
shakirshakiel / virsh_snapshot.rb
Created January 10, 2019 18:04
Take snapshot xmls using virsh and ruby
pools=`virsh pool-list --all --name`.split("\n").map(&:strip)
Dir.mkdir("./pools") unless Dir.exists?("./pools")
Dir.mkdir("./volumes") unless Dir.exists?("./volumes")
pools.each do |pool|
`virsh pool-dumpxml --pool #{pool} > ./pools/#{pool}.xml`
vol_list = `virsh vol-list --pool #{pool} | awk 'NR > 2' | awk '{print $1}'`.split("\n").map(&:strip)
vol_list.each do |vol|
`virsh vol-dumpxml --vol #{vol} --pool #{pool} > ./volumes/#{vol}.xml`
end
# https://ask.openstack.org/en/question/67752/unable-to-delete-port/
# https://ask.openstack.org/en/question/54024/how-to-delete-a-subnet-in-neutron/
subnet_pattern=$1
subnet_ids=$(neutron subnet-list | grep $subnet_pattern | cut -d"|" -f2)
for i in $subnet_ids;
do
echo "subnet is $i"
port_ids=$(neutron port-list | grep $i | cut -d"|" -f2)
for port in $port_ids;
do
@shakirshakiel
shakirshakiel / sample.pac
Last active June 21, 2018 18:57
Sample pac file
function FindProxyForURL(url, host) {
return "1.1.1.1"
}