Skip to content

Instantly share code, notes, and snippets.

View etem's full-sized avatar

Etem Hyusnev etem

  • Somewhere in the cloud...
View GitHub Profile
@etem
etem / setup.md
Created March 14, 2024 18:46 — forked from Yatoom/setup.md
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@etem
etem / .gitignore
Created February 19, 2024 20:05 — forked from debovema/.gitignore
OpenWrt custom firmware for Xiaomi Mi Router 3g (with FPU emulator enabled, custom packages preinstalled, AzireVPN preconfigured)
openwrt/
@etem
etem / jbl-flip-3.md
Created November 30, 2023 15:51 — forked from balrog-kun/jbl-flip-3.md
JBL Flip 3 auto-standby solutions

When using the JBL Flip 3 (or JBL Flip 2 or JBL Flip 4) as a permanent speaker for music or Text-to-speach announcements, connected through the AUX input and powered consantly it still goes into an automatic standby after some time of silence and it's a major problem in this use case. Depending on how long the silence was and how loud the new input audio is, it may take between 3 to 30 seconds in my experience before it resumes playing. For lack of a better place I'm posting here the information I have on solving this.

  1. Obviously emitting the audio signal at maximum volume from the computer and lowering the volume at the speaker reduces the time for it to wake up. Downsides: less volume control for the computer (especially problematic if it's remotely controlled), still won't work if the audio played is relatively quiet or short (such as a home-automation announcement) so not a definitive solution.
  2. Mixing unaudible waveforms into the audio output, either low frequency (< 20Hz) or high (> 15kHz). Downs
@etem
etem / wsl2.md
Created February 16, 2021 10:37 — forked from rfaita/wsl2.md
Installing WSL2 on Windows 10

Install and configure WSL2 on windows 10

Install WSL2

Using the following link here install the WSL 2 on your windows 10.

Install X-Server

VcXsrv seems to the best choice for X-Server in Windows

@etem
etem / dbm2m.py
Created November 4, 2019 13:06 — forked from cryptolok/dbm2m.py
convert WiFi signal strength (dBm) to distance (meters)
#!/usr/bin/env python2
# a simple script for one of my articles - https://cryptolok.blogspot.com/2017/08/practical-wifi-hosts-triangulation-with.html
from math import log10
MHz=raw_input('MHz FREQUENCY (2417, 5200, ...) : ')
MHz=int(MHz)
dBm=raw_input('dBm TRANSMITTER POWER (23, 63, ...) : ')
@etem
etem / screen.md
Created October 7, 2019 15:34 — forked from fredrick/screen.md
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@etem
etem / .md
Created September 30, 2019 13:25 — forked from rahulrajaram/.md
Python: Write to a file from multiple threads

I recently came across the need to spawn multiple threads, each of which needs to write to the same file. Since the file will experience contention from multiple resources, we need to guarantee thread-safety.

NOTE: The following examples work with Python 3.x. To execute the following programs using Python 2.7, please replace threading.get_ident() with thread.get_ident(). As a result, you would need to import thread and not threading.

  1. (The following example will take a very long time). It will create 200 threads, each of which will wait until a global lock is available for acquisition.
# threading_lock.py
import threading
@etem
etem / tmux-cheatsheet.markdown
Created February 25, 2019 18:23 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@etem
etem / rules-both.iptables
Created April 11, 2018 13:17 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is