Skip to content

Instantly share code, notes, and snippets.

faniska / enable_eco_mode.bash
Created Feb 10, 2020
Enabling ECO Mode for MSI Modern 14A laptop to dicrease fan RPM
View enable_eco_mode.bash
echo -n -e "\xc2" | sudo dd of="/sys/kernel/debug/ec/ec0/io" bs=1 count=1 conv=notrunc seek=242
faniska /
Last active Sep 6, 2020
Autostart mining
sleep 10
export DISPLAY=:0
/usr/bin/xset -dpms
/usr/bin/xset s off
sudo /usr/bin/nvidia-smi -pm 1
sudo /usr/bin/nvidia-smi -pl 90
faniska /
Created Jun 16, 2019
ETH Mining - Manjaro OS
  1. Install Manjaro OS selecting nonfree drivers

  2. Run

sudo EDITOR=nano visudo

and uncomment the line

View site_pinger.php
function get_url($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "PC Tester Curl");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
faniska /
Last active Nov 21, 2017
Notify and lock screen on Ubuntu Linux
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"
/usr/bin/notify-send -i face-wink "Пятиминутка" "Сделай паузу!"
/bin/sleep 2
loginctl lock-session 3
faniska /
Last active May 21, 2020
Install wkhtmltopdf with patched QT on Ubuntu Linux
# Uncomment the next line if you have installed wkhtmltopdf
# sudo apt remove wkhtmltopdf
cd ~
# Select an appropriate link for your system (32 or 64 bit) from the page and past to the next line
tar xvf wkhtmltox*.tar.xz
sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin
sudo apt-get install -y openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig
faniska /
Created Sep 20, 2017
Time Planner: Calculating end date or task duration with given working days, hours, holidays eth
# -*- coding: utf-8 -*-
import datetime
from dateutil import parser as dt_parser
class TimePlanner:
holidays = None
weekend = None
working_hours = None
You can’t perform that action at this time.