2021-04-14

Linux 常用命令

sleep 10 && xset dpms force off


ps -aux


sudo lsof -i:3389


ssh -L 3389:localhost:5900 -C -N -l rocky localhost

sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 3389 -j REDIRECT --to-port 5900


sudo apt-get remove openssh-client openssh-server

sudo apt-get install openssh-client openssh-server


gsettings set org.gnome.Vino require-encryption false  //

Ubuntu Setup

sudo apt update

Chrome

https://www.google.com/chrome/


DoubleCommand

sudo apt install doublecmd-gtk


qbittorrent

sudo apt-get update && sudo apt-get install qbittorrent 

https://github.com/bill-ahmed/qbit-matUI

2020-12-31

Port Forward using Ngrok

1. Visit
https://ngrok.com/
2. Download
https://ngrok.com/download
3. Register using unique key
4. Run
ngrok http 111 -host-header="localhost:1111"
5. Config
tunnels:
    proxy:
        proto: http
        addr: 8080
        host-header: localhost:8080
    gui:
        proto: tcp
        addr: 888
        host-header: localhost:888
x

2020-04-07

Highlight table row to highlight Episodes


<script>
    var episodeStringArray = ['S10E', 'S11E', 'S12E', 'S13E', 'S14E', 'S15E', 'S16E', 'S17E', 'S18E', 'S19E', 'S20E', 'S21E', 'S22E', 'S23E', 'S24E', 'S25E', 'E1', 'E01', 'E2', 'E02', 'E3', 'E03', 'E4', 'E04', 'E5', 'E05', 'E6', 'E06', 'E7', 'E07', 'E8', 'E08', 'E9', 'E09', 'E10', 'E11', 'E12', 'E13', 'E14', 'E16', 'E17', 'E18', 'E19', 'E20', 'E21', 'E22', 'E23', 'E24', 'E25', 'E26', 'E27', 'E28', 'E29', 'E30', 'EP1', 'EP01', 'EP2', 'EP02', 'EP3', 'EP03', 'EP4', 'EP04', 'EP5', 'EP05', 'EP6', 'EP06', 'EP7', 'EP07', 'EP8', 'EP08', 'EP9','EP09', 'EP10', 'EP11', 'EP12', 'EP13', 'EP14', 'EP16', 'EP17', 'EP18', 'EP19', 'EP20', 'EP21', 'EP22', 'EP23', 'EP24', 'EP25', 'EP26', 'EP27', 'EP28', 'EP29', 'EP30', 'EP31', 'EP32', 'EP33', 'EP34', 'EP35', 'EP36', 'EP37', 'EP38', 'EP39', 'EP40',' SP '];

    $('tr').each(function () {
        var title = $(this).text().toUpperCase();
        if (episodeStringArray.some(v => title.indexOf(v) > 1)) {
            $(this).css("background-color", "#F4F1F1 ");
            console.log(1);
        }
    })

</script>

2020-04-04

Add GreyMode for Site

CSS:

.greyMode {
    -moz-filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
    filter: gray; /* IE6-9 */
    filter: grayscale(100%);
}


Homepage:

<html class="greyMode">

2019-10-28

Batch Rename File/Folder with C#

            // BATCH RENAME FOLDER
            System.IO.DirectoryInfo _dirAA = new System.IO.DirectoryInfo(@"C:\Users\rockymay\Downloads\ROCKY\xx\");
            foreach (System.IO.DirectoryInfo _dir in _dirAA.GetDirectories())
            {
               foreach(var _dir1 in _dir.GetDirectories())
                {
                    foreach (var _dir2 in _dir1.GetDirectories())
                    {
                        foreach (var _dir3 in _dir2.GetDirectories())
                        {
                            if (_dir3.Name.Contains("[BT-btt.com]"))
                            {

                                string _name = _dir3.Name.Replace("[BT-btt.com]", "");
                                string newpath = _dir2.FullName + "\\" + _name;
                                System.IO.Directory.Move(_dir3.FullName, newpath);
                                Console.Write("#");
                            }
                        }
                    }
                }
            }



            // BATCH RENAME FILE
            foreach (String filePath in Directory.GetFiles(@"C:\Users\rockymay\Downloads\ROCKY\xx\", "*.*", SearchOption.AllDirectories))
            {
                File.Move(filePath, filePath.Replace("[BT-btt.com]", ""));
                Console.Write("#");
            }

2019-10-01

Crop Image in C#

                //Crop Image to Proper Size

                var img = Image.FromFile("screenshot.png");
                Bitmap bmpImage = new Bitmap(img);
                Bitmap bmpCrop = bmpImage.Clone(new Rectangle(1370, 340, 200, 140), bmpImage.  //width distance, height distance,  new share width, new shape height
                PixelFormat);
                bmpCrop.Save("12.jpg");





Setup VNC on Ubuntu 20.04

  sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...