Skip to content

Instantly share code, notes, and snippets.

View scaratec's full-sized avatar

Randy Gupta scaratec

View GitHub Profile
@scaratec
scaratec / docker_kernel_options.md
Last active October 9, 2016 10:05
Debian Kernel Boot Options for Docker

#Debian Kernel Boot Options for Docker

Debian users will notice that docker stats won't output a memory usage of the containers. To solve this just add the following option to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:

  cgroup_enable=memory swapaccount=1

Then run cgroup_enable=memory swapaccount=1

@scaratec
scaratec / docker_memory.md
Created April 14, 2016 07:33
Show overall memory consumption of a docker container

Sometimes it is tricky to calculate the required memory for a docker container. To show the current allocated memory (VSZ) run this command from inside the container:

ps --no-headers -o pcpu,vsz | awk '{cpu += $1; vsz += $2} END {print cpu, vsz}'
@scaratec
scaratec / gist:7507d5ca612a77060094
Created January 18, 2016 15:18
SCARATEC Root CA
-----BEGIN CERTIFICATE-----
MIID1TCCAr2gAwIBAgIJANKts1P5KesmMA0GCSqGSIb3DQEBCwUAMEYxJDAiBgNV
BAoMG1NDQVJBVEVDIElULUNvbnN1bHRpbmcgR21iSDEeMBwGA1UEAwwVU0NBUkFU
RUMgUk9PVCBDQSAyMDE0MB4XDTE0MTEyMDE1NTQ1M1oXDTI0MTExNzE1NTQ1M1ow
RjEkMCIGA1UECgwbU0NBUkFURUMgSVQtQ29uc3VsdGluZyBHbWJIMR4wHAYDVQQD
DBVTQ0FSQVRFQyBST09UIENBIDIwMTQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQC160Eslyjt7YjZE63RePuny7tdYAwY7/WjgarwcUpIy1xxPOerdbMg
hiZhxxSynrhyUlpFgB/9t9T7IUPZXG55/KHjobvbJMjX20Uo7r+8GPPIdiSS4uP1
KfRVwTnmmLIhQFCgMz5bwNJHnx1n20idbnPOckiRZZawK8QIk76x2SHWxPmvjBm0
py98zNmrYrAXVCGOWdWoH5kn2NmQh3c0yO0gVrWsoMrvEN/S2KgxbwyJRbbdqP8/
@scaratec
scaratec / id_rsa.pub
Created January 16, 2016 20:53
My public ssh-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDrKQ9fM7nnRZQUc9Ubg0vkoeJ77JsR7jF2BD6rq3VmbNCYFl5Kp0EfcuOP38X5MeLCd3LSeLUpfO3vrv5xWU6RMqyDjUPa+VecfDbvR/MMk4HlXB6ClZUeF9/DEkdrQEZ44oncdyYIBd1sHT6TPaClV81ifzBHuL24kIVisVI+zEg8s0sDkawvbMUNcooJty6onR2octrJP+bZl3gFOlALR/vdf725rt0rlKSCDkVvNmtLtZT0oc/tez3lS12kr1HyEI8xUn95dcIvFU0pL5F7x3t56U1VqEmh3UeOxQsPBEqfwPvMWf4Vtj6qsfRj6JvM+vEgwVxMCzIO4muXDyW9IPlY2d49t5nOzHQqsoT8uvbDsDIW5yOJ4yJGyLjAtxWkIa3NRL1uS3xdpKg6dPo+yeIWddL9CTf2E76cltwdxzEgko3xOVJGi70ICmOMWmcT5EE0eV0SlQS6NREz2PtXCNJGw61A9uc83aQ/WYsOyNp48vkgNTiDSds/GZfDgIFH2zEPxgKq9AkW90Spqv+NS9ceiGPjQjg6VQCF4+YbK0AM6oI1fTkCEr9UUw7lB7hW7/jBOrubG5M0wj5G0X6b7C30rb8a3sJIwUnI38n9W+juayDvOjDXQyuGDylopecWakPu3jteUG0JtBFnaZNtQfMT3oW8upq/O+HVfU4F4Q== randy@randy-notebook
@scaratec
scaratec / gpt_grub_tutorial.md
Last active January 28, 2019 01:32
How to install Debian Jessie on a LVM Rootpartition

How to install Debian Jessie on a LVM Rootpartition

This document describes the installation of Debian Jessie via debootstrap on a Logical Volume which in turn is installed on a Software Raid managed by mdadm. The partition table will be gpt with grub2

Please note that this doc is primarily for my personal use but I want so share it with the community. If you have any amendments please just leave me a note or send me a pull-request.

Motivation
When operating large virtual machines, there is a need a making backups with minimum downtime. My strategie here is to shutdown the vm (like a Windows Server on KVM) to have them in a consistent state. Then I create a LVM snapshot and start the machine again.

This gives me the time to write the im

@scaratec
scaratec / elasticsearch_cheat_sheet.md
Last active September 24, 2015 15:04
Elasticsearch code snippets

Cheat Sheet Elasticsearch

Json-Editor

Show status:

    curl -X GET http://localhost:9200/

Show all indexes:

I hereby claim:

  • I am scaratec on github.
  • I am randygupta (https://keybase.io/randygupta) on keybase.
  • I have a public key whose fingerprint is A316 5C7C BFCA 5995 759C 7BA8 DA64 2045 B755 842A

To claim this, I am signing this object:

{