Skip to content

Instantly share code, notes, and snippets.

View deeagle's full-sized avatar
Dev on Linux

Martin Kock deeagle

Dev on Linux
View GitHub Profile
@deeagle
deeagle / debian-xcrypt_2.0-update-log.sh
Last active April 30, 2021 09:16
Simple log solution to do debian updates and get the problematic updates logged and run repair-debian-lib-XCRYPT_2.0.sh after (further details see: https://gist.github.com/deeagle/768bc0b50bf705e6edb027a04c14c076).
#!/usr/bin/env bash
XCRYPT_CHECK_BIN="/<path-to-folder>/repair-lib-xcrypt2.0.sh"
UPDATE_LIST_PATH="/tmp/debian-xcrypt_2.0-update-log.list"
UPDATE_LOG="/var/log/debian-xcrypt_2.0-update-log.log"
function log() {
local state=${1}
local msg=${2}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deeagle
deeagle / pandasSimple.python3
Last active June 28, 2020 19:47
Simple example do get data from an URL into python pandas in a jupiter notebook.
#!/usr/bin/python3
import pandas as pd
import urllib
# the url of the data resource
url = "https://data.seattle.gov/resource/6vkj-f5xf.csv"
# the name of the local file to store the data from the url
seattle_inventory_filename = "seattle-inventory.csv"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@deeagle
deeagle / repair-debian-lib-XCRYPT_2.0.sh
Last active April 15, 2023 23:27
Simple fix for a debian linux upgrade to bullseye. Some packages will show an error message like `/usr/bin/perl: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found (required by /usr/bin/perl` and you have to link the new spot of the library. Update: I have to run it before installs and upgrades and everything is fine.
#!/bin/bash
# Needed for debian upgrade
# atm from buster to bullseye the linked libs are broken
# see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951880
LIB="libcrypt.so.1"
# Checks if the executer has super user permissions.
#
Meta: bla bla
Datastamp:
Queries:
Id: 1,
Comment: foo is so bar,
SQL:
SELECT bla
FROM foobar;
ID: 2,
Ccomment: xxx
@deeagle
deeagle / SimpleTemplate.py
Created November 27, 2016 19:34
Simple template substitution of plain text and python3
#!/usr/bin/python3
from string import Template
# open the file
filein = open('SimpleTemplate.tpl')
# read it
src = Template(filein.read())
# document data
hello_to = "Henry"
#! pyhton3
def get_file_as_line(filename):
"""Returns the whole content of a file as one line"""
print('Read file: {0}'.format(filename))
with open(filename) as file_object:
lines = file_object.readlines()
content_string = ''
for line in lines:
content_string += line.rstrip()