Skip to content

Instantly share code, notes, and snippets.

View soulmachine's full-sized avatar

Frank Dai soulmachine

View GitHub Profile

Install Redis on Debian 10

Install and Configure

apt install redis-server
sudo systemctl enable redis
sudo systemctl restart redis
sudo systemctl status redis
@soulmachine
soulmachine / proxmox.md
Last active December 8, 2019 10:54
Proxmox VE settings
  1. Open /etc/apt/sources.list.d/pve-enterprise.list and comment out the following line
# deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
  1. Remove No valid subscription

    Backup proxmoxlib.js:

@soulmachine
soulmachine / WordCountPercentage.java
Last active November 12, 2019 18:50
Calculate Word Count Percentage
package me.soulmachine;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
@soulmachine
soulmachine / LearningRateBatchScheduler.py
Created May 6, 2019 01:26
LearningRateBatchScheduler copied from experimental/resnet50_keras/resnet50.py
# Copied from https://github.com/tensorflow/tpu/blob/master/models/experimental/resnet50_keras/resnet50.py#L117
from absl import logging
from tensorflow.keras import backend as K
BASE_LEARNING_RATE = 0.4
# Learning rate schedule
LR_SCHEDULE = [ # (multiplier, epoch to start) tuples
(1.0, 5), (0.1, 30), (0.01, 60), (0.001, 80)
@soulmachine
soulmachine / _install.sh
Created June 25, 2018 05:34 — forked from marklit/_install.sh
Find the cheapest availability zone across all regions for an EC2 spot instance type
pip install sh
{"sig":"3f031dfe09afeaaefd498c2f625e1b378b8fdf789af7c65e475bb5c5cdb857787af439cca7a1d0f4ff4daf77c583fdb5394b07955b6a4e9f4ec666793a7d825c1","msghash":"6a83f85fc481f8a2d48e421b83bbdee911a73d067fbe8d1af65ee18b9dd4cd27"}
@soulmachine
soulmachine / BleedingInk.java
Last active January 22, 2018 05:54
Bleeding Ink
package me.soulmachine;
import java.util.*;
public class BleedingInk {
class State {
int x;
int y;
int parentDarkness;
@soulmachine
soulmachine / openssl-aes-encrypt.sh
Created December 12, 2017 19:49
openssl aes encrypt command line
# encrypt file.txt to file.enc using 256-bit AES in CBC mode
openssl enc -e -aes-256-cbc -salt -in file.txt -out file.enc
# the same, only the output is base64 encoded for, e.g., e-mail
openssl enc -e -aes-256-cbc -a -salt -in file.txt -out file.enc
# decrypt binary file.enc
openssl enc -d -aes-256-cbc -in file.enc -out file.txt
# decrypt base64-encoded version
@soulmachine
soulmachine / manual-uninstall-paragon-ntfs.sh
Created December 12, 2017 15:00 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# Just delete .config and .support in folder "/Library/Application Support/Paragon Software/"
# then you will get an another 10 days trial.
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
@soulmachine
soulmachine / config.h
Created April 23, 2013 03:44
写纯C代码时用的公共头文件
/** @file config.h
* @brief 公共头文件
* @author soulmachine@gmail.com
* @date 2010-8-3
* @version 0.1
* @note 无
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_