This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mat.h" // from MATLAB | |
#include "matrix.h" // from MATLAB | |
#include "matio.h" // https://github.com/tbeu/matio | |
#include "string.h" | |
#include "stdlib.h" | |
/* | |
* Open a MAT-file "filename" using mode "mode". Return | |
* a pointer to a MATFile for use with other MAT API functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
imgs=($(find . -type f)) | |
imgc=${#imgs[@]} | |
for (( i=0; i<${imgc}; i++ )); | |
do | |
img="${imgs[$i]}" | |
sum=($(md5sum ${img})) | |
ext=$(echo ${img} | sed 's/^.*\.//g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#LOG=/root/auto/reboot.log | |
LOG=/dev/null | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
DEBIAN_FRONTEND=noninteractive | |
echo >> ${LOG} | |
echo ----- >> ${LOG} | |
date -Isec >> ${LOG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get list | |
code --list-extensions | xargs -L 1 echo code --install-extension | |
# apply list | |
code --install-extension geddski.macros | |
code --install-extension James-Yu.latex-workshop | |
code --install-extension jithurjacob.nbpreviewer | |
code --install-extension mrorz.language-gettext | |
code --install-extension ms-vscode.cpptools | |
code --install-extension tickleforce.scrolloff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 64-bit only | |
// sizeof(long): 8 byte | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <sys/mman.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dump_str(str) { | |
for (let i = 0; i < str.length; ++i) { | |
if (i % 16 === 0) { | |
console.log(''); | |
process.stdout.write(('00000' + i.toString(16)).slice(-6) + ' |'); | |
} | |
const _ = ('0' + str.charCodeAt(i).toString(16)).slice(-2); | |
process.stdout.write(' ' + _); | |
} | |
console.log(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
# CLSID_CMpegVideoCodec | |
[HKEY_CLASSES_ROOT\CLSID\{feb50740-7bef-11ce-9bd9-0000e202599c}] | |
@="MPEG Video Decoder" | |
[HKEY_CLASSES_ROOT\CLSID\{feb50740-7bef-11ce-9bd9-0000e202599c}\InprocServer32] | |
@="quartz.dll" | |
"ThreadingModel"="Both" | |
[HKEY_CLASSES_ROOT\CLSID\{083863F1-70DE-11D0-BD40-00A0C911CE86}\Instance\{feb50740-7bef-11ce-9bd9-0000e202599c}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Erase all messages by you from all servers. | |
# Consider use this script before deleting account. | |
# modified from https://github.com/elevenchars/discorddelete/blob/master/main.py | |
# This is a self-bot script. Use at your own risk. | |
# https://support.discordapp.com/hc/en-us/articles/115002192352 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import colorama | |
import time | |
import tqdm | |
def timer(minute, color): | |
print(colorama.Style.BRIGHT + color, end='\r') | |
for i in tqdm.trange(minute * 60, bar_format='{l_bar}{bar}|{n_fmt:>4s}/{total_fmt:>4s}'): | |
time.sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# auto deploy a fake mirror of aozora.gr.jp | |
http://aozora.local { | |
root /www/aozora | |
log /dev/shm/caddy-aozora.log | |
# install with http.git | |
git { | |
# clone official site copy | |
repo https://github.com/aozorabunko/aozorabunko.git | |
path /www/aozora |
OlderNewer