Skip to content

Instantly share code, notes, and snippets.

View hroncok's full-sized avatar

Miro Hrončok hroncok

View GitHub Profile
@hroncok
hroncok / wedos-updatedns.py
Last active January 24, 2021 13:45
OpenShift WEDOS domain updater
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
OpenShift WEDOS domain updater
==============================
This script makes sure that your main domain (example.org) resolves to the
same IP address as your WWW domain (www.example.org). When you run your
webapp on OpenShift, you should set CNAME DNS records, however, this is not
possible for main domains, such as example.org without a subdomain.
# TABLE je ve skutečnosti instanční proměnná, ale berte to, jakože je globální
def solve():
TABLE = {} # slovník/hash kde klíče budou dvojice
for cost in MAX_COST..0:
weight, combo = _solve(NUMITEMS, cost)
if weight <= CAPACITY:
maxcombo = combo
maxcost = cost
@hroncok
hroncok / g2.c
Created February 8, 2016 21:11
/* 3SAT instance generator G2(n,m) */
/* created by M.Motoki */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
void gen_unique_instance(int, int); /* generate 3CNF with at least 1 solution t*/
void sat_alloc(int n, int m, int k);
void write_sat(FILE *fp, int n, int m, int k);
[Desktop Entry]
Version=1.1
Name=CloudCompare Viewer
GenericName=3D point cloud viewer
Comment=Application for 3D point cloud (and triangular mesh) viewing
Type=Application
Exec=ccViewer %U
Icon=ccviewer
Terminal=false
Categories=Graphics;
@hroncok
hroncok / micro-bindings.json
Last active July 1, 2020 17:21
My micro key bindings to simulate what I'm used to in bash, ipython and geany
{
"CtrlLeft": "WordLeft",
"CtrlRight": "WordRight",
"CtrlShiftLeft": "SelectWordLeft",
"CtrlShiftRight": "SelectWordRight",
"CtrlUp": "MoveLinesUp",
"CtrlDown": "MoveLinesDown",
"CtrlShiftHome": "SelectToStart",
"CtrlShiftEnd": "SelectToEnd",
"CtrlW": "DeleteWordLeft",
@hroncok
hroncok / pyconcz2018-twitter.asciidoc
Created June 5, 2018 20:36
Twitter statistics for #PyConCZ and #PyConCZ2018 in 2018

Twitter statistics for #PyConCZ and #PyConCZ2018 in 2018

Includes tweets created between 2018-05-01 and 2018-06-06

  • Number of tweets (excluding RTs): 198

  • Number of likes: 1747

  • Number of retweets: 223

  • Number of tweeting users: 77

; generated by Slic3r 1.2.9 on 2017-03-12 at 16:07:38
; external perimeters extrusion width = 0.40mm
; perimeters extrusion width = 0.48mm
; infill extrusion width = 0.48mm
; solid infill extrusion width = 0.48mm
; top infill extrusion width = 0.48mm
M107
G90
@hroncok
hroncok / shebangs.ipynb
Created October 15, 2018 11:24
Shebang mangling stats
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(repoquery --repo=rawhide -f '/usr/bin/*3.7*' --qf "%{NAME}" 2>/dev/null;
repoquery --repo=rawhide -f '/usr/bin/*3' --qf "%{NAME}" 2>/dev/null;
repoquery --repo=rawhide -f '/usr/bin/python3-*' --qf "%{NAME}" 2>/dev/null) | sort | uniq > py3_cmd_pkgnames
(for pkg in $(cat py3_cmd_pkgnames); do
repoquery --repo=rawhide -l $pkg 2>/dev/null
done) | grep ^/usr/bin | grep 3 | sort | uniq > py3_cmds
for command in $(cat py3_cmds); do
normalized=$(echo $command | sed 's|/usr/bin/python3-|/usr/bin/|' | sed -E 's|-?3(\.7)?||')
@hroncok
hroncok / myfailures.py
Last active July 28, 2020 07:48
Watch my FTBFSes
#!/usr/bin/env python3
# usage: $ watch -n 300 myfailures.py $(whoami)
import re
import sys
from urllib.request import urlopen
URL = 'https://kojipkgs.fedoraproject.org/mass-rebuild/f33-failures.html'
USER = sys.argv[1]