Skip to content

Instantly share code, notes, and snippets.

b3rew

Block or report user

Report or block b3rew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View monero-gpu-nvidia.sh
#!/usr/bin/env bash
project="https://github.com/fireice-uk/xmr-stak-nvidia"
name="monero"
cwd=eval echo "~$USER"
echo "installing.."
sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit libmicrohttpd-dev libssl-dev cmake cmake-curses-gui build-essential -y
echo "DONE"
@b3rew
b3rew / monero.sh
Last active Oct 18, 2017
clone monero minner
View monero.sh
#!/usr/bin/env bash
project="https://github.com/fireice-uk/xmr-stak-cpu.git"
name="monero"
cwd=eval echo "~$USER"
echo "installing.."
sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev -y
echo "DONE"
@b3rew
b3rew / certbot-cron.crontab
Created Mar 28, 2017
certbot renewal cron letsencrypt
View certbot-cron.crontab
55 23 * * */2 alias sudo='sudo -H'
57 23 * * */2 echo "password" | sudo /opt/certbot/certbot-auto renew # don't use this method
57 23 * * */2 unalias sudo
@b3rew
b3rew / default
Created Mar 13, 2017
nginx sites-available
View default
server {
listen *:9999;
server_name localhost;
location / {
root /path/to/folder/;
index index.html index.htm;
}
location /api {
View var_let.js
var sum = 0;
var length = 1000000000;
var i = 0;
// let j = 0;
console.time("let time");
for(let j = 0;j<length;j++){
sum += j;
}
console.timeEnd("let time");
console.info("let total ", sum)
@b3rew
b3rew / reduce_for.js
Created Feb 15, 2017
reduce vs for loop
View reduce_for.js
var top = 10000000;
var glass = [];
var t = 0;
var sum = 0;
for(var i = 0;i<top;i++){
t += i;
glass[glass.length] = {amount: t}
}
console.time("for time");
@b3rew
b3rew / mongoDB.js
Last active Jul 14, 2017
MongoDB query cheetsheet
View mongoDB.js
//update test collection
db.test.update({foo: "bar"}, {$set: {test: "success!"}}, {multi: true})
//Find duplicate records by key_name in MongoDB
db.collection.aggregate(
{"$group" : { "_id": "$key_name", "count": { "$sum": 1 } } },
{"$match": {"_id" :{ "$ne" : null } , "count" : {"$gt": 1} } },
{"$project": {"key_name" : "$_id", "_id" : 0} }
)
You can’t perform that action at this time.