Skip to content

Instantly share code, notes, and snippets.

@yeutterg
yeutterg / Mac Chrome Application Shortcuts 2018-06.txt
Last active October 6, 2020 17:33
How to enable Application Shortcuts on Chrome for Mac, as of June 2018
How to get "Application Shortcut" functionality on Chrome for Mac, as of January 2020:
1. Visit the web page you would like to turn into an application
2. Navigate to Settings > More Tools > Create Shortcut...
3. Give the app a name, make sure "Open as window" is enabled, and click Create
4. The folder Chrome Apps should open in finder. Drag the new app shortcut to the dock or another location for easy access
That's it! You can even quit the app (Cmd-Q) without closing other Chrome windows, as it acts like a separate Mac app.
@xiaoping378
xiaoping378 / geth.service
Last active February 27, 2019 09:52
geth systemd service
[Unit]
Description=Ethereum go client
After=network.target
[Service]
Type=simple
Restart=always
RestartSec=30s
ExecStart=/usr/sbin/geth --syncmode "fast" --ws --rpc --rpcapi "eth,net,web3,admin,personal,txpool,miner,clique" --rpccorsdomain "*" --rpcaddr 0.0.0.0 --cache 2048 --trie-cache-gens 1024 --txpool.accountslots 1024 --txpool.globalslots 40960
@bsodmike
bsodmike / README.md
Last active March 13, 2023 05:04
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"
@swaldman
swaldman / GethAsAService.md
Last active October 9, 2022 02:18
Setting up geth as a service under systemd (Updated for Fedora 27)

Setting up geth as a service under systemd Fedora 27

Prerequisite: dnf install golang

  1. Create user geth with useradd
  2. As user geth fast sync the blockchain, geth --fast --cache 1024
  3. Manually run geth --rpc as user geth and watch to see that the blockchain continues to sync properly
  4. Install the geth.service file (also in this gist) in /usr/lib/systemd/system/
  5. Make a symlink from /etc/systemd/system/multi-user.target.wants/geth.service to /usr/lib/systemd/system/geth.service
  6. systemctl enable geth followed by systemctl start geth
@squadbox
squadbox / cool_gpu2.sh
Last active December 6, 2023 05:34
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <akohlmey@gmail.com>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds
@freyr
freyr / php-example.php
Created June 11, 2015 10:18
GetResponse APIv2 example
<?php
# Demonstrates how to add new contact to campaign.
# JSON::RPC module is required
# available at http://github.com/GetResponse/DevZone/blob/master/API/lib/jsonRPCClient.php
require_once 'jsonRPCClient.php';
# your API key is available at
# https://app.getresponse.com/my_api_key.html
@tmcallaghan
tmcallaghan / wiredtiger-snappy.conf
Created February 19, 2015 12:30
YAML Config for MongoDB 3.0.0 - wiredtiger snappy
storage:
dbPath: "./data"
directoryPerDB: true
journal:
enabled: true
engine: "wiredTiger"
wiredTiger:
engineConfig:
cacheSizeGB: 8
journalCompressor: snappy
@sheharyarn
sheharyarn / mongo_backup.sh
Last active January 23, 2024 16:54
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@magnetikonline
magnetikonline / README.md
Last active July 7, 2024 05:27
Setting Nginx FastCGI response buffer sizes.
@openrijal
openrijal / ip2geo.sh
Created April 3, 2013 18:33
Bash Script to find Geolocation from IP Addresses in apache's access log. You need to have "geoiplookup" package from GeoLite package. The excerpts are taken from http://danielmiessler.com/blog/a-simple-script-for-harvesting-dns-country-state-and-city-information-from-a-list-of-ip-addresses
#!/usr/bin/env bash
cat /var/log/apache2/access_log | awk '{print $1}' > ips.txt
uniq ips.txt > uniqips.txt
IPS=`cat uniqips.txt`
for i in $IPS
do
echo "$i,`geoiplookup $i | cut -d "," -f2 | sed -e 's/^[\t]//'`" >> ipinfo.csv
done