Skip to content

Instantly share code, notes, and snippets.

Dec 18 02:20:02 |Dl| ###################### 22 MB/s
|Ul| ######################################## 40 MB/s
Dec 18 02:40:01 |Dl| ################################################# 49 MB/s
|Ul| ################################## 34 MB/s
Dec 18 03:00:01 |Dl| ############################################################### 63 MB/s
|Ul| ################################################# 49 MB/s
Dec 18 03:20:01 |Dl| ####################### 23 MB/s
|Ul| #################### 20 MB/s
Dec 18 03:40:01 |Dl| ###################################################################################### 86 MB/s
|Ul| ########################################################## 58 MB/s
@vahit
vahit / gist:3f42e9dd2b7cd40f2537621745332970
Created October 24, 2017 21:24
backlight controller in Archlinux
#!/usr/sbin/env bash
set -exuo pipefail
# Backlight controller
# IMPORTANT!!
# YOU MUST RUN THESE TWO COMMANDS AFTER EVERY REBOOT SINCE I FIND A PROPER SOLUTION.
# # chown root:user sys/class/backlight/intel_backlight/max_brightness
# # chmod 664 sys/class/backlight/intel_backlight/max_brightness
@vahit
vahit / i3lock_photo.sh
Created August 14, 2017 04:27
Take a photo with webcam if someone insert the wrong passwd -- For i3lock (you need fswebcam!)
echo " " > /tmp/i3lock_log.txt ##clear log
_date()
{
date=`grep 'pam_unix(i3lock:auth): authentication failure' /tmp/i3lock_log.txt | awk {'print $3'} | tail -n 1`
}
_date
pht="0"
2017-08-08 09:50:52: netdata INFO : Adjusted my Out-Of-Memory score to '1000'.
2017-08-08 09:50:52: netdata ERROR: Cannot adjust netdata scheduling policy to idle (5), with priority 0. Falling back to nice (errno 38, Function not implemented)
2017-08-08 09:50:52: netdata INFO : netdata started on pid 1.
2017-08-08 09:50:52: netdata INFO : Registry is disabled - use the central netdata
2017-08-08 09:50:52: netdata ERROR: HEALTH [Domain.xx]: cannot open health file: /var/lib/netdata/health/health-log.db.old (errno 2, No such file or directory)
2017-08-08 09:50:52: netdata ERROR: HEALTH [Domain.xx]: cannot open health file: /var/lib/netdata/health/health-log.db (errno 2, No such file or directory)
2017-08-08 09:50:52: netdata INFO : Host 'Domain.xx' (at registry as 'Domain.xx') with guid '1107d056-7c1f-11e7-8b7a-001e67ec746a' initialized, os linux, tags '', update every 1, memory mode ram, history entries 3996, streaming enabled (to '--master-ip--:19999' with api key '3a9757fe-5308-40c0-98b1-0a3d1b16b62e'), heal
2017-08-08 08:48:15: INFO: Using python v2
2017-08-08 08:48:15: INFO: YAML output is ordered
2017-08-08 08:48:15: python.d INFO: reading configuration file: /usr/libexec/netdata/plugins.d/../../../../etc/netdata/python.d.conf
2017-08-08 08:48:15: python.d INFO: MODULES_DIR='/usr/libexec/netdata/python.d/', CONFIG_DIR='/usr/libexec/netdata/plugins.d/../../../../etc/netdata/', UPDATE_EVERY=1, ONLY_MODULES=['mysql']
2017-08-08 08:48:15: python.d DEBUG: mysql: loading module configuration: '/usr/libexec/netdata/plugins.d/../../../../etc/netdata/python.d/mysql.conf'
2017-08-08 08:48:15: python.d DEBUG: mysql: reading configuration
2017-08-08 08:48:15: python.d DEBUG: mysql/local: job added
2017-08-08 08:48:15: python.d DEBUG: all job objects [<Service(local, initial daemon)>]
2017-08-08 08:48:15: python.d INFO: CHECKED OK: mysql_local
2017-08-08 08:48:15: python.d INFO: RENAMED: mysql_db-2 , from mysql_local
full_text=〉
align=center
color=#87ceeb
separator=false
separator_block_width=2
[Language]
command=/usr/libexec/i3blocks/language
interval=1
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@vahit
vahit / animal farm
Created June 11, 2015 19:16
Animal Farm Audio Book
http://nastale.com/blog/DL/AnimalFiction.ogg
http://nastale.com/blog/DL/AnimalFictionS2.ogg
http://nastale.com/blog/DL/AnimalFictionS3.ogg
http://nastale.com/blog/DL/AnimalFictionS4.mp3
http://nastale.com/blog/DL/AnimalFictionS5.ogg
http://nastale.com/blog/DL/AnimalFictionS6.ogg
http://nastale.com/blog/DL/AnimalFiction-S7.ogg
http://nastale.com/blog/DL/AnimalFarm-S8.ogg
http://nastale.com/blog/DL/AnimalFarm-S9.ogg
http://nastale.com/blog/DL/AnimalFarm-S10.ogg
@vahit
vahit / tk-class2.py
Created February 9, 2015 14:46
tkinter simple OO code II
#!/usr/sbin/env python
import tkinter as tk
class Demo1:
def __init__(self, master):
self.master = master
def create_frame(self):
@vahit
vahit / tk-class.py
Created February 8, 2015 15:46
tkinter simple OO code.
#!/usr/sbin/env python
import tkinter as tk
class Demo1:
def __init__(self, master):
self.master = master
def create_frame(self):