Skip to content

Instantly share code, notes, and snippets.

@faniska
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
#!/bin/bash
echo -n -e "\xc2" | sudo dd of="/sys/kernel/debug/ec/ec0/io" bs=1 count=1 conv=notrunc seek=242
@faniska
faniska / autostart.sh
Last active Sep 6, 2020
Autostart mining
View autostart.sh
#!/bin/sh
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
faniska / eth-mining-manjaro.md
Created Jun 16, 2019
ETH Mining - Manjaro OS
View eth-mining-manjaro.md
  1. Install Manjaro OS selecting nonfree drivers

  2. Run

sudo EDITOR=nano visudo

and uncomment the line

%wheel ALL=(ALL) NOPASSWD: ALL
View site_pinger.php
<?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
faniska / 5min_gnome.sh
Last active Nov 21, 2017
Notify and lock screen on Ubuntu Linux
View 5min_gnome.sh
#!/bin/sh
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
faniska / wkhtmltopdf.sh
Last active May 21, 2020
Install wkhtmltopdf with patched QT on Ubuntu Linux
View wkhtmltopdf.sh
# 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 https://wkhtmltopdf.org/downloads.html and past to the next line
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
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
faniska / time_planner.py
Created Sep 20, 2017
Time Planner: Calculating end date or task duration with given working days, hours, holidays eth
View time_planner.py
# -*- 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.