Posts

Life is a marathon

life is a journey. It can be short or it can be long. It's not a short race if you choose to live. How far you go is totally depends on how long you want to go and how persistent you are. So put your sadness and weakness back, let's go and see how far we can reach.

How to create a "c python"?

In python, all python code are translated into c action in real time. Line by line. If python can do it, c can do it too. In other words, you can create a c_interpreter to translate c code into real time c actions. So that you can create variable in real time, do math operations in real time. import another c file in real time. A example would be: ``` int i = 999; i = i + 1; ``` becomes ``` int *i = (int *)malloc(sizeof(int)); *i = 999; *i = *i + 1; ``` By doing so, you can have a python_like c interpreter, you can run your c code without using gcc again. You can bypass the glibc version restrictions. You can have a python_like interpreter that could handle memory pointer stuff, and speed is just as quick as c. > Sometimes, I think the python is a remote controller, you give it code, it run it line by line to control your computer. Now c could do the same thing.

How to create a web service in your local machine while let public server people visit

nginx域名映射到内网ip端口你肯定会 https://yingshaoxo.blogspot.com/2020/06/how-to-set-frp-with-nginx.html     除了使用frp反射本地port到服务器port, 就连ssh都自带一个port映射,在局域网搭建公网服务实在是太简单了 ``` # in server vim /etc/ssh/sshd_config GatewayPorts yes systemctl restart sshd # in local ssh -R 0.0.0.0:6666:0.0.0.0:9999 your_server_ip   此时外部访问 http://your_server_ip:6666 才会被转发到你本机的 9999 端口 ``` 如此以来,你只需要买一个最便宜的服务器,只要不限流量就行。甚至几百个人共用一个服务器都可以,反正一个服务器有6万多个port.

How to set up a general php5.4 and mysql5.6 service in docker

# How to set up a php5.4 project under linux ## Install php and mysql ``` #/root/docker-compose.yaml version: "3.9" services:   old_php_5.4:     image: yeszao/php:5.4.45-fpm-alpine     network_mode: "host"     volumes:       - /xp/www:/var/www/html:rw     working_dir: /var/www/html     command: sh -c "php -S [::]:7171 -t ."     restart: always   mysql56_db:     image: mysql:5.6     network_mode: "host"     environment:       MYSQL_ROOT_PASSWORD: "root"       MYSQL_USER: "user"       MYSQL_PASSWORD: "user"     volumes:       - ./mysql_data:/var/lib/mysql     restart: unless-stopped #    old_php: #      image: php:5.4.45-apache #    ...

Review in 2024 and Plans for 2025

# Review in 2024 and Plans for 2025   ## Failed to do at 2024 Nothing. I successfully found, I successfully made my body stronger.   ## Success at 2024 1. As a home boy, I found "my girlfriend" got better skills to make me happy. I mean, if you do a watch at those porn videos, you may found they got better quality at graph. Better actions to make you happy. 2. I almost made my own phone, both in software system and hardware. But since I can't make my own CPU, so the dependence is not stable. So useless. 3. I have "upgraded" the auto_everything project. Now it has more useful and simple algorithm inside. 4. I have meet or made more friends in a school called "Huan Di Jiao Yu".   ## Plan to do in 2025 Keep a balance and health life, both in body and work.

How to set a out network whitelist firewall in linux?

 A whitelist firewall only allows user to visit a list of domain or ip. ufw is a fake one, it can not block out traffic.   https://github.com/yingshaoxo/yingshaoxo_v2ray_linux32?tab=readme-ov-file#android-client

How to install a linux system by copy disk partition

 If you can copy the whole disk, then do it, it works better. 1. copy your old alpine system partition as a iso file, especially make sure the `/boot` folder has files: `vmlinuxz-grsec` and `initramfs-grsec`. `dd if=/dev/sdb2 of=xx.iso` 2. use dd to copy that disk partiton to your new computer partition, a ext4 would be fine. `dd if=xx.iso of=/dev/sdb2` 3. i am using `lubuntu16_i386` system to work as a PE system, all you have to do is install lubuntu16_i386 to another partition of your disk. It will generate a not working version of grub boot menu for you, you can see "unknown linux distrubution" when you boot your computer. you need to fix it later. 4. boot into lubuntu16, `sudo su`, `vim /etc/grub.d/40_custom`, add following to the bottom: ``` menuentry 'Alpine' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root -...

How to backup data and sync data in a safe way? -- made by yingshaoxo

  Suppose you have 3 disk, 1MB disk, 10GB disk, 1TB disk. In 1MB disk, you only save folder tree, there has no files in each folder. In 10GB disk, it has all folder from 1MB disk, and for some folder, it got some files in those folder, but only pure text file. Each file is less than 10MB. In 1TB disk, it has all folders and files from 10GB disk, but it got more files, more types of file, some file even bigger than 100MB. For all 3 disks, they all have a txt file at top, that txt file contains all folder and files tree information of 1TB disk. To sync those disks, all you have to do is use `rsync` to copy all files and folder from 1MB to 10GB, then do the same thing from 10GB to 1TB. But for file deletion, you only do the deletion at your level disk, you do not have permission to delete file in smaller size disk.