Skip to content

Instantly share code, notes, and snippets.

@sanakhanlibre
sanakhanlibre / test-vm.yaml
Created November 14, 2022 06:56
KubeVirt VirtualMachine
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: test-vm-ubuntu
name: test-vm-ubuntu
spec:
template:
metadata:
creationTimestamp: null
@sanakhanlibre
sanakhanlibre / test-dv.yaml
Created November 14, 2022 06:53
KubeVirt DataVolume
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: import-pv-datavolume
spec:
source:
http:
url: "http://10.x.x.x/focal.img"
storage:
volumeMode: Block
docker.io/kubernetesui/dashboard:v2.2.0
docker.io/kubernetesui/metrics-scraper:v1.0.6
docker.io/coredns/coredns:1.8.3
k8s.gcr.io/pause:3.4.1
k8s.gcr.io/k8s-dns-dnsmasq-nanny:1.15.10
k8s.gcr.io/k8s-dns-kube-dns:1.15.10
k8s.gcr.io/k8s-dns-sidecar:1.15.10
k8s.gcr.io/metrics-server-amd64:v0.3.6
quay.io/coreos/kube-state-metrics:v1.9.8
quay.io/cephcsi/cephcsi:v2.1.2
@sanakhanlibre
sanakhanlibre / aws_cli.txt
Last active May 27, 2020 03:34
AWS EC2 CLI
$ aws ec2 describe-instances --region xx
$ aws ec2 describe-instances --region xx
--query 'Reservations[*].Instances[*].[Tags[?Key==`Name`].Value[]]'
--output text
$ aws ec2 describe-instances --region xx
--query 'Reservations[*].Instances[*].[Tags[?Key==`Name`].Value[],
State.Name, Placement.AvailabilityZone, InstanceType, PublicIpAddress,PrivateIpAddress]'
--output text
@sanakhanlibre
sanakhanlibre / icinga2 services API response
Created August 11, 2017 08:50
https://localhost:5665/v1/objects/services/host-01!service-check-xyz
{
"results": [
{
"attrs": {
"__name": "host-01!service-check-xyz",
"action_url": "",
"active": true,
"check_command": "check-xyz",
"command_endpoint": "",
"display_name": "service-check-xyz",
vagrant@vagrant-ubuntu-trusty-64:~/devstack$ sudo ovs-vsctl show
1b4a5572-a524-46f8-a2cc-6d0a3c0d2db7
Bridge br-tun
fail_mode: secure
Port br-tun
Interface br-tun
type: internal
Port patch-int
Interface patch-int
type: patch
vagrant@vagrant-ubuntu-trusty-64:~/devstack$ openstack network list
+--------------------------------------+---------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+---------+--------------------------------------+
| 4fde2c69-918f-4859-9264-81cab0cf7446 | private | 3eef7a49-fca1-416e-82bc-97d75b0f8010 |
| d3324a72-d0b9-4033-8f05-b5adfe791108 | public | 8b10aec7-2867-46fe-b049-44d8ea55525a |
+--------------------------------------+---------+--------------------------------------+
vagrant@vagrant-ubuntu-trusty-64:~/devstack$ neutron router-list
+--------------------------------------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-------+
@sanakhanlibre
sanakhanlibre / tried15.rb
Created August 26, 2014 19:36
-- needs to be fixed
require 'read_dump'
require 'heap_dump/diff'
class Display
def initialize
heapdump1_file = ARGV.shift
heapdump2_file = ARGV.shift
before = Rubinius::HeapDump::Decoder.new
before.decode(heapdump1_file)
@sanakhanlibre
sanakhanlibre / percentage.txt
Created August 26, 2014 18:57
Output showing per class, how many objects of that class are taking up how much bytes.
Class_id:4 Class_name:Rubinius::ByteArray Number_of_Objects:113438 Size:6175172
4348 Objects [1 Percent] occupy 24 bytes each
3338 Objects [1 Percent] occupy 28 bytes each
1148 Objects [0 Percent] occupy 32 bytes each
45 Objects [1 Percent] occupy 2068 bytes each
48 Objects [0 Percent] occupy 112 bytes each
740 Objects [0 Percent] occupy 40 bytes each
991 Objects [0 Percent] occupy 36 bytes each
322 Objects [0 Percent] occupy 48 bytes each
[
{"id":2,"bytes":24,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":6,"bytes":28,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":8,"bytes":28,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":10,"bytes":32,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":12,"bytes":28,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":14,"bytes":2068,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":16,"bytes":112,"class_id":4,"class":"Rubinius::ByteArray"},
{"id":18,"bytes":40,"class_id":4,"class":"Rubinius::ByteArray"},