Skip to content

Instantly share code, notes, and snippets.

Jiří Prokop synaptiko

Block or report user

Report or block synaptiko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@synaptiko
synaptiko / 01-how-to-modify-physical-display-size-in-edid.md
Last active Apr 1, 2019
How to modify physical display size in EDID (on ArchLinux with systemd boot)
View 01-how-to-modify-physical-display-size-in-edid.md

How to modify physical display size in EDID

Following method describes how to fix EDID display size information of your monitor if it's wrong (some of Samsung's monitors report incorrect size when connected over HDMI, for example). It assumes that your monitor is connected to HDMI1 port (HDMI-A-1 is full kernel address).

I used following tools:

@synaptiko
synaptiko / i3msg-jq.sh
Created Aug 30, 2016
Example how to use i3msg command
View i3msg-jq.sh
#!/usr/bin/env bash
isWorkspaceFocused=$(i3-msg -t get_workspaces | jq 'map(select(.focused==true))|map(.num)|map(select(. == 10))|length' 2> /dev/null)
isKicktermRunning=$(i3-msg -t get_tree | jq "recurse(.nodes[]) | .window_properties | objects | .class" | grep '"Kickterm"' | wc -l 2> /dev/null)
if [ $isKicktermRunning -eq 0 ]; then
/home/jprokop/Projects/kickterm/new-i3.py >& /dev/null
fi
if [ $isWorkspaceFocused -eq 0 ]; then
View Concealed text in terminal on linux terminal
echo -e "\e[8;32mI'm hidden!\e[0m"
node
> console.log('\033[8;32mI'm hidden!\033[0m')
rust
println!("\x1B[8;32mI'm hidden!\x1B[0m");
// documentation here: http://ascii-table.com/ansi-escape-sequences.php
View workshop-clovece-rozblikej-to.bas
#picaxe 08m2
' Odkaz https://gist.github.com/synaptiko/10754510
' Tabulka názvů proměnných, které lze v 08M2 použít:
' b0:b1 b2:b3 b4:b5 b6:b7 b8:b9 b10:b11 b12:b13 b14:b15 b16:b17 b18:b19 b20:b21 b22:b23 b24:b25 b26:b27
' w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13
' b* = 1 byte, tj. 256 různých hodnot
' w* = 2 byty, tj. 65 536 různých hodnot
' Kromě těchto dvou jde použít i bit* pro nastavení pouze 2 hodnot (true/false)
' Pozor bit0-bit7 se překrývá s b1. Stejně tak b1 a b2 se překrývá s w1. Analogicky je to i pro ostatní proměnné.
@synaptiko
synaptiko / screen-how-to.md
Last active Dec 20, 2015
Screen command manual excerpt
View screen-how-to.md

Příkazy:

Ctrl+a +

  • create – vytvoří nový terminál
  • previous – přepne na předchozí terminál
  • next – přepne na následující terminál
  • 09 – přepne na terminál dle pořadí od nuly
  • " – zobrazí seznam otevřených terminálů (se shiftem!)
  • renAme – přejmenování aktuální obrazovky
  • Split – rozdělí obrazovku
@synaptiko
synaptiko / index.html
Last active Mar 13, 2016
Servo PWM controller as Node.js service (requires kernel and modules from Adafruit's Occidentalis: http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2)
View index.html
<!DOCTYPE html>
<html>
<head>
<style>
label {
display: inline-block; width: 100px; height: 20px; float: left; text-align: left;
}
input {
display: inline-block; width: 25%; height: 20px;
}
@synaptiko
synaptiko / index.html
Last active Dec 19, 2015
LED PWM with Python & Node.js
View index.html
<!DOCTYPE html>
<html>
<head>
<style>
label {
display: inline-block; width: 20px; height: 20px; float: left; text-align: center;
}
input {
display: inline-block; width: 25%; height: 20px;
}
@synaptiko
synaptiko / tooHotLed.js
Created Jun 19, 2013
Simple program combining temperature sensor and led through GPIO.
View tooHotLed.js
#!/usr/bin/env node
var fs = require('fs');
var gpio = require("gpio");
var gpio10 = gpio.export(10, {
direction: "out",
ready: function() {
function readTemperature() {
var data = fs.readFileSync('/sys/bus/w1/devices/28-0000047c275a/w1_slave', { encoding: 'ascii' });
var temperature;
View speed-test.sh
#!/bin/sh
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
@synaptiko
synaptiko / daemon.sh
Created Jun 9, 2013
Bash shell script which let run PROCESS_COMMAND forever until daemon is called with kill parameter.
View daemon.sh
#!/usr/bin/env bash
SCRIPT_PATH=$(readlink -f $0)
DIR=$(dirname $SCRIPT_PATH)
PID_DIR="${DIR}/pid"
LOG_DIR="${DIR}/log"
DAEMON_PID_FILE="${PID_DIR}/daemon.pid"
DAEMON_LOG_FILE="${LOG_DIR}/daemon.log"
PROCESS_PID_FILE="${PID_DIR}/process.pid"
You can’t perform that action at this time.