Skip to content

Instantly share code, notes, and snippets.

View tlatsas's full-sized avatar

Tasos Latsas tlatsas

View GitHub Profile
@tlatsas
tlatsas / pkg.md
Last active December 19, 2015 07:29
package managers cheatsheet (work in progress)

install

action rpm based debian based pacman
install pkgname yum install pkgname apt-get install pkgname pacman -S pkgname
install pkgfile rpm -ivh pkgfile dpkg -i pkgfile
apt-get install -f
pacman -U pkgfile

remove

@tlatsas
tlatsas / centos.md
Last active February 8, 2019 18:42
centos cheatsheet

CentOS cheatsheet

Installing EPEL repo on Centos 6.x

# curl -O http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

rpm and yum

import subprocess
import shlex
def _run(command):
"""subprocess wrapper to execute system commands, command is expected as string"""
try:
p = subprocess.Popen(shlex.split(command),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = p.communicate()
Jun 27 22:29:45 zen systemd[1]: Started udev Kernel Device Manager.
Jun 27 22:29:45 zen kernel: ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \GPIS 1 (20130117/utaddress-251)
Jun 27 22:29:45 zen kernel: ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 2 (20130117/utaddress-251)
Jun 27 22:29:45 zen kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
Jun 27 22:29:45 zen kernel: ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20130117/utaddress-251)
Jun 27 22:29:45 zen kernel: ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GP01 2 (20130117/utaddress-251)
Jun 27 22:29:45 zen kernel: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
Jun 27 22:29:45 zen kernel: ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \GPIO 1 (20
@tlatsas
tlatsas / georandomizer.py
Last active December 18, 2015 12:39
read coordinates from csv and randomize them within metres
#!/usr/bin/env python3
import csv
import os
import sys
import math
import random
class Point(object):
def __init__(self, latitude, longitude, bearing=None):
@tlatsas
tlatsas / gist2.md
Created June 12, 2013 10:20
test gist 2

Test 2

This is included in wigiki! \o/

@tlatsas
tlatsas / gist1.md
Created June 12, 2013 10:19
test gist 1

Test

This is a markdown formatted gist.

@tlatsas
tlatsas / android.md
Last active December 18, 2015 07:39
android notes

Android notes

development

create a new project

android create project --target 1 \
  --name some_name --path some-path \
 --activity MyActivity --package com.some.name
#!/usr/bin/env python
import sys
def save_csv(lines, filename):
print(filename)
with open(filename, 'w') as f:
for line in lines:
f.write("{}\n".format(line))
@tlatsas
tlatsas / reports2tabular.sh
Last active December 17, 2015 12:09
incident report data -> latex tabular
#!/bin/sh
while read line; do
echo '\hline'
echo $line"\\\\" | sed 's/°/\\degree/' |
awk '
BEGIN{OFS=" & "}
{
print $1,$2,$3,$4$5$6$7$8,$9
}