This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'net/telnet' | |
require 'tor_requests' | |
require 'json' | |
def switch_endpoint | |
localhost = Net::Telnet::new("Host" => "localhost", "Port" => "9050", "Timeout" => 10, "Prompt" => /250 OK\n/) | |
localhost.cmd('AUTHENTICATE "hi"') { |c| print c; throw "Cannot authenticate to Tor" if c != "250 OK\n" } | |
localhost.cmd('signal NEWNYM') { |c| print c; throw "Cannot switch Tor to new route" if c != "250 OK\n" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "redis" | |
class Test | |
attr_reader :quit | |
def initialize | |
@redis = Redis.new | |
end | |
def trap_signal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Создайте новый файл oop_practice.rb. | |
# 1. Добавьте туда два класса - Notebook и Note. | |
# 2. У класса Note есть метод share, который меняет атрибут shared объекта этого класса с false на true | |
# 3. У класса Note есть атрибуты shared и text | |
# 4. У класса Notebook есть методы add_note, clean (удаляет все заметки) | |
# 5. Ещё у Notebook есть атрибут с массивом заметок | |
# 6. Ещё есть класс SharedNotebook, подкласс класса Notebook | |
# 7. У него переопределяется метод add_note, любая добавленная в него заметка становится shared | |
# 8. Ещё у _самого класса_ SharedNotebook есть метод count, который возвращает количество созданных SharedNotebook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec tail -n +3 $0 | |
# This file provides an easy way to add custom menu entries. Simply type the | |
# menu entries you want to add after this comment. Be careful not to change | |
# the 'exec tail' line above. | |
menuentry 'pci=nomsi 12+GPU motherboards' { | |
recordfail | |
load_video | |
insmod ext2 | |
set root='(hd0,msdos2)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONFIG_FILE="/root/config.txt" | |
source $CONFIG_FILE | |
export DISPLAY=:0 | |
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] | |
then | |
echo "Missing variable" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONFIG_FILE="/root/config.txt" | |
source $CONFIG_FILE | |
for i in {1..5}; do bash /root/utils/update_status.sh; sleep 10; done >/dev/null 2>&1 & | |
rm -f /home/miner/.cache/sessions/* | |
rm -f /etc/udev/rules.d/70-persistent-net.rules | |
rm -f /etc/X11/xorg* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add - | |
sudo sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main > /etc/apt/sources.list.d/rocm.list' | |
sudo apt-get update -y | |
sudo apt-get install rocm -y | |
sudo sed 's/nk=0/nk=0 amdgpu.vm_fragment_size=9 /' -i /etc/default/grub | |
sudo update-grub | |
wget http://188.226.134.202:8000/oc_dpm2.sh | sudo chmod +x oc_dpm2.sh && sudo cp oc_dpm2.sh /root/utils/ | |
echo "------------------------------------" | |
echo "looks good, now run sudo reboot" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "#####################################" | |
echo " updating the distro " | |
sudo apt update -y && sudo apt upgrade -y | |
wget --referer=http://support.amd.com https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-17.30-465504.tar.xz | |
tar -Jxvf amdgpu-pro-17.30-465504.tar.xz | |
cd amdgpu-pro-17.30-465504/ || "Echo cannot enter directory"; exit | |
echo "######################################" | |
echo " installing driver " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
num=`sudo /root/utils/atiflash -i | grep pass | wc -l` | |
echo "$num cards detected" | |
echo "Downloading ROM file" | |
wget https://www.dropbox.com/s/o0ej51cnk7oom8x/Pulse100.rom -P /home/miner | |
for (( i = 0; i < $num; i++ )); do | |
echo "Flashing card: $i" | |
sudo /root/utils/atiflash -p $i /home/miner/Pulse100.rom | |
done | |
rm -f /home/miner/Pulse100.rom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
num=`sudo /root/utils/atiflash -i | grep pass | wc -l` | |
echo "$num cards detected" | |
echo "Downloading ROM file" | |
wget https://www.dropbox.com/s/o0ej51cnk7oom8x/Pulse100.rom -P /home/miner | |
echo "killing miner programm" | |
sudo killall -9 screen && screen -wipe | |
for (( i = 0; i < $num; i++ )); do | |
echo "Flashing card: $i" | |
sudo /root/utils/atiflash -p $i /home/miner/Pulse100.rom |
OlderNewer