Sort Xeggex orders by date and time with AWK
This article is considering formatting date and time and sorting by date and time.
My example orders look like this
This article is considering formatting date and time and sorting by date and time.
My example orders look like this
There are many ways to switch on NumLock in Linux. Some methods do not work. I used this one before:
apt install numlockx
cat .xinitrc
#!/bin/shif [ -e /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
But now i prefer simpler way, using Xfce4 settings.
Using terminal very often it is convenient to start terminal with some keyboard shortcut, for example with just pressing Right Menu button (right button with logo). This is how to do that.
LXDE works with Openbox, so there is a file ~/.config/openbox/lxde-rc.xml with some configurations, also there are Keyboard shortcuts:
Open file for editing with vim or any editor like gedit, mousepad or so:
vim ~/.config/openbox/lxde-rc.xml
Connecting Android to your Linux you need to use gvfs. Rsync also wants to set files timestams that is why you need this hack.
For use MTP devices in terminal need to use gvfs-use:
apt install gvfs-fuse
and reboot.
ls /run/user/1000/gvfs
'mtp:host=Samsung_A7_caf675d6'
Next follow to that folder you need to store your data.
Get info from Bitget.com using API in Bash.
You may need to install jq first:
apt install jq
/api/spot/v1/public/currencies
curl -s 'https://api.bitget.com/api/spot/v1/public/currencies' | jq .
curl -s 'https://api.bitget.com/api/spot/v1/public/currencies' | jq '.data[].coinName' | wc -l
359
Using bash it is possible to compare time easily in epoch format. If you need to compare date like 14:23 with 14:17 you need to transform it to seconds since epoch and compare as two integers. Here it is my function in ~/.bashrc and examples
Starting long process you may want to watch how much time is it going. This helps you to guess how much time remains.
Usually you run some process and then watch on it in another terminal window in a loop `while [ 1 ]`.
For example, need to count minutes since the process start. Algorithm and simple bash script are here.
start=$(date +%s)
This stores start point as POSIX time in seconds like: 1660042758
When formatting usb flash, it always only creates new partition table at the start sectors and remain all the rest as it was. So, it is possible to read the rest data, analyze and get old data if your flash will be in hacker's hands. If your data must be totally removed from flash, it needs to fill entire drive with zeroes.
Simplest way is to use 'dd', but it takes much time and reduces lifetime of usb flash:
dd if=/dev/zero of=/dev/FLASH
When transcode video or catch bugs in live stream, sometimes it is necessary to log ffmpeg messages with also date and time. This is possible with awk.
Here we use test stream link from [3]. We run ffplay for check its work:
ffplay https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8 2>&1 | awk 'NF {print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush()}'
Explanation:
Running websites on different CMS or different versions of the same CMS, it is usual that some sites need PHP 7.4, others PHP 7.2 and others can work on PHP 8.0 and so on. Centos 7 now has several php-fpm packages, and this article describes how to run two or more php-fpm services and configure nginx to use certain php version for certain site.
Check current php version
php -v
PHP 7.4.30 (cli) (built: Jun 7 2022 08:38:19) ( NTS )