Skip to content

Instantly share code, notes, and snippets.


Sadegh sadegh

View GitHub Profile
package com.skazemy;
import java.util.ArrayList;
import java.util.List;
* This example shows that after calling wait() on an object, it will release that object's monitor lock,
* so that other threads can enter the synchronized block. It also shows once notifyAll()
* is called, first that thread has to exit the synchronized block, then each waiting thread starts
* doing their work one by one, each has to exit their synchronized block so the other can wake up
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --disassociate
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//')
networksetup -detectnewhardware
View .gitconfig
st = status
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
colorMoved = dimmed_zebra
# makes git diff recognize and de-emphasise moved code instead of showing it as deleted+added. git 2.17
sadegh /
Created Dec 26, 2017 — forked from bsodmike/
OC Nvidia GTX1070s in Ubuntu 16.04LTS for Ethereum mining

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards.

First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
public class PausableExecutor extends ThreadPoolExecutor {
private boolean isPaused;
private ReentrantLock pauseLock = new ReentrantLock();
private Condition unPaused = pauseLock.newCondition();
You can’t perform that action at this time.