Skip to content

Instantly share code, notes, and snippets.

View hroncok's full-sized avatar

Miro Hrončok hroncok

View GitHub Profile
; 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.
@hroncok
hroncok / svgto3d
Last active May 20, 2019 23:35
Get a list of svg files and convert them to prepared scad designs. You'l than have to modify only the size.
#!/usr/bin/env bash
# Public domain
if [ $# -lt 1 ]; then
echo "Give me some file(s), dude!" 1>&2
exit 1
fi
for svg in $@; do
shortname="$(basename "$svg")"
(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)?||')
#!/usr/bin/python3
import bugzilla
import sys
import logging
assert sys.version_info[0] > 2, 'Needs Python 3'
PKG = sys.argv[1]
@hroncok
hroncok / .bashrc
Last active February 27, 2020 12:23
.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
@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 / 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]
@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.
#!/usr/bin/python3
# Copyright (c) 2020-2021 Fedora Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of