Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@artizirk
artizirk / index.html
Last active December 22, 2015 12:49 — forked from darwin/index.html
My awesome comics
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">I'm awesome</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|2,90|16,87">
@artizirk
artizirk / ping_test_script.sh
Created December 8, 2013 22:17
monitors if host is up or down
#!/bin/bash
echo "[`date`][Start] Host alive tester"
host_ip_addr="192.168.10.100"
alive_history=()
alive_history_size=5
while true; do
#ping -nqc1 $host_ip_addr &> /dev/null #ping not good because cant set timeout time
#!/usr/bin/env python3
#######################
#
# Auto scroll while holding down mouse side buttons
#
#
from pymouse import PyMouse
from pymouse import PyMouseEvent
import threading
@artizirk
artizirk / wvdial.conf
Created May 27, 2014 15:38
wvdial config for public ip
[Dialer Defaults]
Modem = /dev/ttyUSB1
Init1 = ATZ
Init2 = ATQ0 V1 E1 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP",""
Stupid Mode = True
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Username = wap
@artizirk
artizirk / test.py
Created June 5, 2014 11:52
Function Annotations test
#!/usr/bin/env python3
######################
# Function Annotations test
from pprint import pprint
def greet(name: "User to greet", greeting: "Greeting to use" = "Hello") -> "String with the greeting":
return greeting + " " + name
int ees_mootor_parem_enable = 12;
int ees_mootor_parem_pwm = 3;
int ees_mootor_vasak_enable = 8;
int ees_mootor_vasak_pwm = 11;
int taga_mootor_parem_enable = 7;
int taga_mootor_parem_pwm = 9;
int taga_mootor_vasak_enable = 5;
int taga_mootor_vasak_pwm = 10;
int kaugus_parem = A2;
int kaugus_vasak = A0;
@artizirk
artizirk / blink.py
Created February 21, 2015 12:03
blink a led at tartu raspberry pi workshop
@artizirk
artizirk / connect.py
Last active January 26, 2022 21:32
Automaticaly connect the first available modem using ModemManager, supports hotplug
#!/usr/bin/env python3
import dbus
from gi.repository import GObject as gobject
from enum import Enum
from dbus.mainloop.glib import DBusGMainLoop
class MMModemState(Enum):
MM_MODEM_STATE_FAILED = -1
MM_MODEM_STATE_UNKNOWN = 0
MM_MODEM_STATE_INITIALIZING = 1
@artizirk
artizirk / readme.txt
Created April 10, 2015 19:34
Huawei E3372h-153
Working Huawei E3372h-153 SETPORT mappings
replacing A1,A2 with FF turns off need for usb_modeswitch
AT^SETPORT="A1,A2;12,1,16,A1,A2"
^GETPORTMODE: TYPE: WCDMA: huawei,PCUI:0,MDM:1,NDIS:2,CDROM:3,SD:4,
AT^SETPORT="A1,A2;1,12,16,A1,A2"
@artizirk
artizirk / powersave.sh
Last active August 29, 2015 14:20
tries to maximize powersave and minimaze heat output so that my DELL Vostro 3360 laptop wouldn't burn my legs when i have it on my lap.
#!/bin/bash
echo "max powersave"
# kill the stupid spinning hdd that i dont use most of the time anyway
sudo hdparm -y /dev/sda
# set some bits on the cpu to make it use less power
sudo x86_energy_perf_policy powersave
# set some more bits on the cpu to disable turbo boost, one command per core
sudo wrmsr -p0 0x1a0 0x4000850089
sudo wrmsr -p1 0x1a0 0x4000850089
sudo wrmsr -p2 0x1a0 0x4000850089