Skip to content

Instantly share code, notes, and snippets.

View amarao's full-sized avatar
⌨️
Pushing buttons hard enough to get paid

George Shuklin amarao

⌨️
Pushing buttons hard enough to get paid
  • Servers.com
  • Limassol, Cyprus
View GitHub Profile
This file has been truncated, but you can view the full file.
[
532824,
533688,
561690,
570123,
563779,
571631,
573299,
581294,
582998,
$ dpkg-architecture -L
uclibc-linux-armel
uclibc-linux-i386
uclibc-linux-ia64
uclibc-linux-alpha
uclibc-linux-amd64
uclibc-linux-armeb
uclibc-linux-arm
uclibc-linux-arm64
uclibc-linux-avr32
@amarao
amarao / mem_hog.py
Created June 4, 2018 09:45
Illustration for python memory fragmentation issue
#!/usr/bin/python3
import random
import time
MAX_HOG = 1000*1000
def sparse(something):
for element in something:
victim = element["big"]
element["big"] = None
- hosts: all
gather_facts: no
serial: 1
tasks:
- name: Remove old facts
meta: clear_facts
- name:
set_fact:
host_v1: '{{ansible_ssh_host}}'
host_v2: '{{ansible_host}}'
totem {
version: 2
cluster_name: debian
token: 3000
token_retransmits_before_loss_const: 10
clear_node_high_bit: yes
@amarao
amarao / blame-praise.py
Last active November 23, 2023 03:31
Example of argparse with subparsers for python
#!/usr/bin/env python
import argparse
def main(command_line=None):
parser = argparse.ArgumentParser('Blame Praise app')
parser.add_argument(
'--debug',
action='store_true',
help='Print debug info'
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xml:lang="en-US">
<s:Header>
<a:Action>http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse</a:Action>
<a:MessageID>uuid:BFBAB472-44A3-4776-B2DE-CD373164FECA</a:MessageID>
<a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
<a:RelatesTo>uuid:ec9ad2e9-56f2-16f2-8002-4f11553e16fa</a:RelatesTo>
</s:Header>
<s:Body>
<n:EnumerateResponse>
/tmp/1.py:11:2: E225 missing whitespace around operator
/tmp/1.py:11:6: E261 at least two spaces before inline comment
/tmp/1.py:11:6: E262 inline comment should start with '# '
/tmp/1.py:12:2: E225 missing whitespace around operator
/tmp/1.py:12:5: E261 at least two spaces before inline comment
/tmp/1.py:12:5: E262 inline comment should start with '# '
/tmp/1.py:13:2: E225 missing whitespace around operator
/tmp/1.py:13:4: E261 at least two spaces before inline comment
/tmp/1.py:13:4: E262 inline comment should start with '# '
/tmp/1.py:14:23: E225 missing whitespace around operator
@amarao
amarao / laptop.md
Created March 22, 2017 14:54
Selecting a linux laptop (spring 2017)

CPU issues

As far as I know there were issues with modern CPUs powersaving in Linux. Step one: what are intel CPUs and how much their differ? CPU names:

  • Sandy Bridge (2nd gen)
  • Ivy Bridge (3th gen)
  • Haswell (4th gen)
  • Broadwell (5th gen) (IAMT, aka IME, has been moved to CPU)
  • Skylake (6th gen)
  • Kaby Lake (7th gen)
#!/usr/bin/python
import subprocess
import json
import sys
def deugly(obj):
try:
ret = {}
for elem in obj[1]: