Skip to content

Instantly share code, notes, and snippets.

View rikka0w0's full-sized avatar

Rikka0_0小六花 rikka0w0

  • UNSW
  • Sydney
View GitHub Profile
@rikka0w0
rikka0w0 / multiplenetwork.md
Last active June 24, 2018 14:48
ss-server with multiple network interface (is there a way to set the outgoing of a ss-server)

Please answer these questions before submitting your issue. Thanks!

(Please mention that if the issue you filed is solved, you may wish to close it by yourself. Thanks again.)

(PS, you can remove 3 lines above, including this one, before post your issue.)

What version of shadowsocks-libev are you using?

shadowsocks-libev 3.1.3

What operating system are you using?

@rikka0w0
rikka0w0 / unfs.md
Last active September 16, 2018 16:46
Usermode NFS Server

unfsd

Server: unfsd -t -n2050 -m2050
Debian:\

apt install nfs-common rpcbind
systemctl start rpcbind

/etc/exports\

@rikka0w0
rikka0w0 / wsl_sshd.md
Created December 7, 2018 06:32
Setup SSH server (SSHD) on WSL

Setup a RSA key only root login SSHD server on WSL

  1. sudo apt-get purge openssh-server
  2. sudo apt-get install openssh-server
  3. sudo nano /etc/ssh/sshd_config PermitRootLogin yes UsePrivilegeSeparation no Port RSAAuthentication yes PubkeyAuthentication yes
@rikka0w0
rikka0w0 / libmicrohttpd_compile.md
Created January 17, 2019 17:29
Compile Libmicrohttpd examples in Linux
apt install libmicrohttpd-dev
pkg-config --list-all | grep libmicrohttpd
gcc hellobrowser.c -o hellobrowser `pkg-config --cflags --libs libmicrohttpd`
@rikka0w0
rikka0w0 / STM32_GCC_Conflicting_CPU_Architectures.md
Created April 30, 2019 06:52
STM32 GCC Conflicting CPU architectures

Error Message: arm-none-eabi/lib/crt0.o: Conflicting CPU architectures

Due to a bug in Ubuntu Bionic, libnewlib-arm-none-eabi 2.4.0.20160527-4 is a broken version

  1. Download latest package from: https://packages.ubuntu.com/cosmic/all/libnewlib-dev/download and https://packages.ubuntu.com/cosmic/all/libnewlib-arm-none-eabi/download
  2. Install them with sudo dpkg -i libnewlib-*.deb

Ref: https://github.com/bbcmicrobit/micropython/issues/514

@rikka0w0
rikka0w0 / Test_PIL_IIR_Filter_STM32-Mat.md
Last active May 10, 2019 20:18
How to run the Test_PIL_IIR_Filter demo of STM32-Mat Target 4.4.2

STM32-MAT Script Fixes:

  1. Comment line 256: fprintf('\n### Code Format : %s\n',buildOpts.codeFormat);
    buildOpts.codeFormat doesnt exist, the execution of this line throws an error and halt the code generation. I'm using Matlab 2019a, Windows 10 1803 x64, Stm32CubeMX 4.25 and STM32MatTarget_4.4.2_setup.exe
  2. Search for "extModeIocUsartUpdate" and add "ioc_info = ioc_parse(ioc_path);" in the next line.
    Note: this is a potential bug, the script creates a new ioc file if it cant find an existing one, but it doesnt read the new ioc file after creation.
  3. Comment below (around line 164):
            cset.set_param ('ExtMode','on');            
            cset.set_param ('ExtModeTransport',0); 
            cset.set_param('ExtModeMexFile','ext_serial_win32_comm');
@rikka0w0
rikka0w0 / dyndns.md
Last active October 21, 2019 00:25
Tweak Netgear D6200

Update dynamic DNS records on Google Domain every hour

Script

#!/bin/sh

### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
@rikka0w0
rikka0w0 / linux_tgt_iscsi_target.md
Last active January 11, 2020 16:13
iSCSI target on

Install TGT iSCSI target

sudo apt install -y tgt
sudo nano /etc/tgt/conf.d/TecMint_iscsi.conf

Write the config file (can be any.conf)

<target qwq.cszombie.net:lun0>
     # Provided device as an iSCSI target
 #direct-store /dev/sdb1
@rikka0w0
rikka0w0 / Fr6ToolChainInfo.java
Last active February 12, 2020 16:37
Add "Stack Analyzer" and "Build Analyzer" from STM32CubeMxIDE to Eclipse AC6
package com.st.stm32cube.ide.mcu.toolchain;
import java.util.Map;
import java.util.function.Supplier;
import com.st.stm32cube.common.ecosystemintegration.core.CompilerEnum;
import com.st.stm32cube.ide.mcu.toolchain.IToolChainInfo;
public class Fr6ToolChainInfo implements IToolChainInfo{
@rikka0w0
rikka0w0 / tunnel_smb_windows.md
Created March 2, 2020 17:21
How to proxy smb on Windows 10 using ssh

short description with ssh n stuff for tunneling

  1. launch hdwwiz.exe
  2. network adapters -> Microsoft KM-TEST Loopback Adapter -> finish
  3. disable everything except ipv4 in that new network sink
  4. inside the ipv4 settings set up a ip, 255.255.255.255 as subnet mask and disable netbios
    • if you cannot decide on an ip simply use 192.0.2.123 since it's not a public ip and most likely will never be used in a LAN environment. (in case you care about vpn compatibility)
  5. elevated windows shell
    • run sc config lanmanserver start= delayed-auto
      this is sadly required since microsoft will bind it's smb bullshit to 0.0.0.0:445 thus making it impossible to listen to that port yourself.