Uncategorized

tmux common commands and best practice

Here are some simple and commonly used tmux commands that will help you navigate and manage your tmux sessions efficiently. Basic tmux Commands 1. Start a new tmux session: tmux This will start a new tmux session and bring you into the tmux environment. 2. Create a new named tmux session: tmux new -s session_name Replace session_name with a name of your choice. 3. Attach to an existing session: tmux attach-session -t session_name If a tmux session is running, this will re-attach to it. 4. List a[…]

tmux common commands and best practice Read More »

Using curl to test speed test of url

I like some fast way to test the connection speed from my local host or my server, so I often use this way to test the connect time speed. time curl -o /dev/null -s -w “Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal time: %{time_total}s\n” [URL] Replace [URL] with the URL you want to test. Here’s a breakdown of the command: time: This will measure the real elapsed time of the entire command. -o /dev/null: Discards the output of the curl command. -s: Makes curl operate in “silent”[…]

Using curl to test speed test of url Read More »

Installing Bitnami WordPress Nginx into Apple m1

Preparing Folders Prepare the a project folders that put your mariadb data and Wordpress files data. # cd ~ # mkdir wp # cd wp # mkdir mariadb # mkdir wordpress The folders we need /Users/juzhax/wp /Users/juzhax/wp/mariadb /Users/juzhax/wp/wordpress Preparing the Docker Compose file touch /Users/juzhax/wp/docker-compose.yml Insert the data using your favorite editor. I like to use vim vim /Users/juzhax/wp/docker-compose.yml version: ‘2’ services: mariadb: image: docker.io/bitnami/mariadb:10.6 vo[…]

Installing Bitnami WordPress Nginx into Apple m1 Read More »

Safely inject the values into SQL

Other than using bind in SQL, this is the old school way to solve the SQL query to prevent injection attack Sample Code // a sample list of values to use in IN(): $values = [1,4,10,’12a’,’xy\’z’]; // VERSION 1. For integers: make sure all array elements are integers $in = implode(‘,’, array_map(‘intval’, $values)); // VERSION 2. For strings: apply PDO::quote() function to all elements $in = implode(‘,’, array_map([$pdo, ‘quote’], $values)); // VERSION 3. Custom sanitization: allow only letters a[…]

Safely inject the values into SQL Read More »

configure: error: Missing required libcurl dev >= 7.18.2

Error in CentOS configure: error: Missing required libcurl dev >= 7.18.2 [root@ns4007603 cgminer]# yum install libcurl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile base: centos.mirror.nexicom.net epel: ftp.osuosl.org extras: centos.mirror.nexicom.net updates: centos.mirror.nexicom.net Setting up Install Process Package libcurl-7.19.7-37.el6_4.x86_64 already installed and latest version Nothing to do You have the newer

configure: error: Missing required libcurl dev >= 7.18.2 Read More »

Error: org.macports.fetch for port sqlite3 returned: fetch failed

Error: org.macports.fetch for port sqlite3 returned: fetch failed Please see the log file for port sqlite3 for details: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_sqlite3/sqlite3/main.log Error: Unable to upgrade port: 1 To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets Solve port -v fetch caml-sqlite3

Error: org.macports.fetch for port sqlite3 returned: fetch failed Read More »

MongoDB Error: exception in initAndListen std::exception: boost::filesystem::exists: Permission denied: “/sys/devices/system/node/node1”

I found this error while installed yum install mongo-10gen-2.2.3 mongo-10gen-server-2.2.3 in CentOS 6.4 64bit Wed Oct 16 16:19:08 [initandlisten] MongoDB starting : pid=22457 port=27017 dbpath=/var/lib/mongo 64-bit host=xxxxxxx.net Wed Oct 16 16:19:08 [initandlisten] exception in initAndListen std::exception: boost::filesystem::exists: Permission denied: “/sys/devices/system/node/node1”, terminating Wed Oct 16 16:19:08 dbexit: Wed Oct 16 16:19:08 [initandlisten] shutdown: going to close

MongoDB Error: exception in initAndListen std::exception: boost::filesystem::exists: Permission denied: “/sys/devices/system/node/node1” Read More »