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
# sudo vim /etc/wireguard/wg0.conf | |
# replace <key> and <eth0> | |
# sudo wg show | |
[Interface] | |
PrivateKey = <key> | |
Address = 10.22.0.0/24 | |
ListenPort = 51820 | |
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o <eth0> -j MASQUERADE | |
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o <eth0> -j MASQUERADE |
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 | |
# | |
# rclone_gphotos_backup.sh | |
# 取得當前日期 (格式: YYYY-MM-DD) | |
YEAR=$(date +'%Y') | |
MONTH=$(date +'%m') | |
YEAR_MONTH="${YEAR}-${MONTH}" |
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
[Unit] | |
Description=Nvim Init Start | |
[Service] | |
ExecStart=/home/jason9075/nvim-startup.sh | |
RemainAfterExit=true | |
Type=oneshot | |
[Install] | |
WantedBy=default.target |
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
{ | |
"pretrained_model_name_or_path": "runwayml/stable-diffusion-v1-5", | |
"v2": false, | |
"v_parameterization": false, | |
"logging_dir": "log資料夾路徑", | |
"train_data_dir": "圖片資料夾路徑", | |
"reg_data_dir": "", | |
"output_dir": "模型輸出路徑", | |
"max_resolution": "512,512", | |
"learning_rate": "0.000001", |
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
Verify Github on Galaxy. gid:BL5qryEKnYaBWPFgi3Rwt |
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
// Test Hello World From MyOpenCv | |
NativeLib cv = new NativeLib(); | |
System.out.println(cv.stringFromJNI()); | |
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.android); | |
cv.toGrey(image, image); | |
iv.setImageBitmap(image); | |
System.out.println(">>> " + cv.getInfo(image)); |
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
extern "C" | |
JNIEXPORT jobject JNICALL | |
Java_com_jason9075_myopencv_NativeLib_getInfo(JNIEnv *env, jobject thiz, jobject bitmap) { | |
Mat src; | |
bitmapToMat(env, bitmap, src, false); | |
int width = src.cols; | |
int height = src.rows; | |
// return java object | |
const char *clsPath = "com/jason9075/myopencv/ImageInfo"; |
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
package com.jason9075.myopencv; | |
import android.graphics.Bitmap; | |
public class NativeLib { | |
static { | |
System.loadLibrary("myopencv"); | |
} |
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
package com.jason9075.myopencv; | |
public class ImageInfo { | |
private final int width; | |
private final int height; | |
public ImageInfo(int width, int height) { | |
this.width = width; | |
this.height = height; | |
} |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
binding = ActivityMainBinding.inflate(getLayoutInflater()); | |
setContentView(binding.getRoot()); | |
setSupportActionBar(binding.toolbar); | |
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main); |
NewerOlder