Skip to content

Instantly share code, notes, and snippets.

@alxcancado
alxcancado / docker-swarm-architecture.md
Created February 27, 2024 22:43 — forked from scyto/docker-swarm-architecture.md
My Docker Swarm Architecture
@alxcancado
alxcancado / _verify-repair-permissions-disk.md
Created May 5, 2019 22:54 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@alxcancado
alxcancado / rigcheck.sh
Created May 4, 2018 18:20
Checks for crashed ethOS mining processes
#!/bin/bash
LOG_FILE=/tmp/rigcheck.log
if grep -qv active /var/run/ethos/status.file; then
echo "$(date) Mining not active or currently starting, exiting..." | tee -a ${LOG_FILE}
exit 0
fi
NUM_PROC=`ps uax| egrep "ccminer|cgminer-skein|claymore|dstm-zcash|ethminer|ethminer-amd|ewbf-zcash|sgminer-gm|silentarmy|optiminer-zcash" | grep -v "curl" | grep -v "update-miner" | grep -v grep | awk '{print $2}' | wc -l`
NUM_GPU=`cat /var/run/ethos/gpulist.raw | wc -l`
NEEDS_RESTART=false
if [ "${NUM_PROC}" != "${NUM_GPU}" ]; then
@alxcancado
alxcancado / check_hashrate_reboot.py
Created May 4, 2018 18:08 — forked from jaydlawrence/check_hashrate_reboot.py
Script to check the hashrate of ethereum worker on ethOs and reboot if the hashrate is 0 for 2 runs of this script. This script is for a single GPU, or rather it will only reboot if the overall hashrate reaches 0. It also uses the pushover service to push notifications for when the script triggers a reboot.
import subprocess
import os
import re
import sys
import argparse
import httplib, urllib
import time
"""
# place this file at /home/ethos/check_hash_reboot.py
@alxcancado
alxcancado / LeanLocalizedTextMeshProUGUI.cs
Created March 7, 2018 19:35
Lean Localization TextMeshPro
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Lean.Localization
{
// This component will update a Text component with localized text, or use a fallback if none is found
[ExecuteInEditMode]
[DisallowMultipleComponent]
[RequireComponent(typeof(TextMeshProUGUI))]
@alxcancado
alxcancado / .gitignore
Created July 9, 2017 17:22 — forked from teocomi/.gitignore
Gitignore for Unity projects
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
/[Bb]uilds/
/[Ll]ibrary/
sysinfo.txt
*.stackdump
@alxcancado
alxcancado / WebLocationChecker.cs
Created April 26, 2017 01:28 — forked from andyman/WebLocationChecker.cs
WebLocationChecker.cs
using UnityEngine;
using System.Collections;
using System.Text;
/**
* WebLocationChecker by @andyman404
* Licensed under Creative Commons Zero (do with it as you want, no credit needed)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* This script site-locks your Unity Webplayer/WebGL build.
@alxcancado
alxcancado / WebLocationChecker.cs
Created April 26, 2017 01:26 — forked from andyman/WebLocationChecker.cs
Simple script for Unity to check the domain that the web player is hosted on, and redirect it to the proper location if it is not in the list of domains. It does nothing if it is not a web player build.
using UnityEngine;
using System.Collections;
using System.Text;
/** Add this script to an object in the first scene of your game.
* It doesn't do anything for non-webplayer builds. For webplayer
* builds, it checks the domain to make sure it contains at least
* one of the strings, or it will redirect the page to the proper
* URL for the game.
*/
@alxcancado
alxcancado / FadeInOut.cs
Last active August 29, 2015 14:25 — forked from docky/FadeInOut.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Game : MonoBehaviour
{
public static Game instance;
public Player player;
public int score = 0;
var stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
// your function here..
stopwatch.Stop();
//Debug.Log("Timer: " + stopwatch.Elapsed);
Debug.Log("Timer: " + stopwatch.ElapsedMilliseconds);
stopwatch.Reset();