Skip to content

Instantly share code, notes, and snippets.

View MitsuhaMiyamizu's full-sized avatar
🌴
On vacation

是夕流芳 MitsuhaMiyamizu

🌴
On vacation
  • Utopia Planitia, Mars.
View GitHub Profile
@MitsuhaMiyamizu
MitsuhaMiyamizu / nut_osx.txt
Created March 4, 2024 14:31 — forked from hdml/nut_osx.txt
Network UPS Tools on macOS High Sierra (netclient)
#install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install network ups tools
brew update
brew install nut
#create directories and change permissions
sudo mkdir -p /var/state/ups/upssched/
sudo chown -R `whoami`:nobody /var/state/ups
sudo chmod 775 /var/state/ups/

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

module TraceGraphs
import TraceCalls: Trace
import PlotRecipes: GraphPlot
using RecipesBase
type MyGraph
source::AbstractVector{Int}
destiny::AbstractVector{Int}
end
@MitsuhaMiyamizu
MitsuhaMiyamizu / SimpleGibbs.md
Last active April 23, 2021 02:28 — forked from dmbates/SimpleGibbs.md
Simple Gibbs sampler in Julia

The Gibbs sampler discussed on Darren Wilkinson's blog and also on Dirk Eddelbuettel's blog has been implemented in several languages, the first of which was R.

This gist was written in purpose of demonstration only and may not exist without the help of @Ionizing.

The task is to create a Gibbs sampler for the unscaled density

 f(x,y) = x x^2 \exp(-xy^2 - y^2 + 2y - 4x)

using the conditional distributions

@MitsuhaMiyamizu
MitsuhaMiyamizu / compile_pytorch_with_icx.md
Created October 6, 2020 08:11 — forked from CaoZhongZ/compile_pytorch_with_icx.md
Compile PyTorch with Intel Compiler Next Generation

Intel Compiler Next Generation

After Intel® Parallel® Studio XE 2020, you could use icx/icpx to enable intel compiler next generation code generator. It combined clang frontend and icc's cutting edge optimization, ideal for opensource projects which already supported opensource compilers.

Setup Intel Compiler Environment

After installed Parallel® Studio, setup compilation environment.

. /opt/intel/bin/compilervars.sh intel64

Start Compilation

#!/bin/bash
wkpath1=/home/path/to/clean
wkpath2=/home/path/to/clean/bowtie2
bowtie2_index=/home/path/refgenome/grch38/grch38
ref=/home/path/blacklist/ENCFF356LFX.bed
temp=/home/path/to/clean/temp
for i in $(cat ${wkpath1}/sra.id)
do
sample_name=`basename $i`
bowtie2 -p 6 --very-sensitive -X 2000 -x $bowtie2_index \
@MitsuhaMiyamizu
MitsuhaMiyamizu / bamfilter_oneliners.md
Created August 25, 2020 10:59 — forked from davfre/bamfilter_oneliners.md
SAM and BAM filtering oneliners
# -*- encoding: utf-8 -*-
# Author: Epix
#
# Ban Xunlei IP for deluge
# This script will check deluge connected peers per 30 seconds.
# When an IP with UA in `BAN_PATTERNS` is found, the IP will be added to `BLOCK_LIST_FILE`.
# However if the IP is uploading or reporting 100% progress, it will say "WTF?"
import logging
# -*- coding:utf-8 -*-
# !/usr/bin/env python3
'''
Author: ayasakinagi
Email: [email protected]
环境: Python3
依赖: deluge_client
使用: 修改host, port, username, password, limitSize, dataPath变量