Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
👋

Adam Kaminski thimslugga

👋
View GitHub Profile
@thimslugga
thimslugga / .xsession
Created September 14, 2018 17:11 — forked from anoother/.xsession
Automatically enable Freesync on Linux
#!/bin/bash
## Enable freesync - put this in eg. your .xsession
## http://support.amd.com/en-us/kb-articles/Pages/HOW-TO-ENABLE-AMD-FREESYNC-IN-LINUX.aspx
set -u
xrandr --prop | while read line; do
if echo "$line" | grep ' connected' > /dev/null; then
monitor=$(echo $line | awk '{print $1}')
@thimslugga
thimslugga / homebridge
Created September 23, 2018 14:42 — forked from johannrichard/homebridge
Systemd Service for homebridge (http://github.com/nfarina/homebridge)
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@thimslugga
thimslugga / README.md
Created November 1, 2018 16:09 — forked from cuibonobo/README.md
VGA Passthrough on virtual machines in CentOS 7

Mainline kernel

After your fresh CentOS 7 setup (make sure you install the QEMU/KVM virtualization tools and virt-manager), install the mainline kernel:

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
sudo yum --enablerepo=elrepo-kernel install kernel-ml
sudo yum -y update
@thimslugga
thimslugga / ping.py
Created November 11, 2018 17:07 — forked from pyos/ping.py
import time
import random
import struct
import select
import socket
def chk(data):
x = sum(x << 8 if i % 2 else x for i, x in enumerate(data)) & 0xFFFFFFFF
x = (x >> 16) + (x & 0xFFFF)
@thimslugga
thimslugga / NMEA Output.md
Created November 29, 2018 18:33 — forked from pklaus/NMEA Output.md
u-blox 7 GPS/Glonass Receiver G-7020 / VK-172

output of the command

screen /dev/ttyACM0 38400

without any prior special settings:

$GPTXT,01,01,02,u-blox ag - www.u-blox.com*50
$GPTXT,01,01,02,HW  UBX-G70xx   00070000 *77
$GPTXT,01,01,02,ROM CORE 1.00 (59842) Jun 27 2012 17:43:52*59

$GPTXT,01,01,02,PROTVER 14.00*1E

@thimslugga
thimslugga / upload-github-release-asset.sh
Created January 15, 2019 19:17 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@thimslugga
thimslugga / install_tesseract_amazon_linux_201803.sh
Last active January 18, 2019 22:37 — forked from IaroslavR/gist:834066ba4c0e25a27078
Install lastest tesseract on Amazon Linux 2018.03
#!/bin/bash
#
# Sources:
# https://gist.github.com/IaroslavR/834066ba4c0e25a27078
# https://ivanzz1001.github.io/records/post/ocr/2017/09/08/tesseract-install
# https://groups.google.com/forum/#!topic/tesseract-ocr/u-PZaakaKs0
#
# Instructions:
# wget -c https://gist.githubusercontent.com/thimslugga/3d8f3bacb0b427d6a84b342a73cb7382/raw/e396348a46b65a8909aecf4c4fa3185ed2303c3a/install_tesseract_amazon_linux_201803.sh
# chmod +x install_tesseract_amazon_linux_201803.sh
@thimslugga
thimslugga / php-ping.php
Created February 18, 2019 17:27 — forked from k0nsl/php-ping.php
PHP ping script
<?php
/*
*
* Use the examples below to add your own servers. Coded by clone1018 [?]
*
*/
$title = "Simple Server Status"; // website's title
$servers = array(
'Google Web Search' => array(
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer