so i just found out that mysql-connector for python from Oracle have a prepared-statement subclass just like their JAVA counterpart.
and here i am using PyMySQL for years like an idiot
so i just found out that mysql-connector for python from Oracle have a prepared-statement subclass just like their JAVA counterpart.
and here i am using PyMySQL for years like an idiot
i always interested with how some shell script is capable to animate their console output, but never put any effort to learn until lately. this is a simple one
open this link:
https://ssl-config.mozilla.org/
copy the given example to your web server.. make some adjustment to your configuration.
use this link to test your new configuration.
just follow this for the compiling process :
https://www.raspberrypi.com/documentation/computers/linux_kernel.htmlbefore compiling the kernel open include/net/bluetooth/hci.h with any text editor and find this line
then replace it with
the websockets can be accessed using ws://{ip-address}:11000.
or maybe using subdirectory on SSL enabled domain
the url now is wss://{domain-name}/ws
There is news in Indonesia about the plan to block WhatsApp and some other services for six days. The plan is to force the company behind them to register their services to KOMINFO during the ban or risk their services being banned permanently.
With the digitalization of the Indonesian citizen registry for the last decade, they should've been able to make their own chat app using NIK as an id number. The users can register the account using their registered SIM card or simply use NFC to scan the id card to automatically log in to the app.
This way the government can proactively protect their citizen from scams that getting more rampant over the last few years, especially during the pandemic. The government can verify the people behind an id and protect businesses and consumers so they can do their business online with peace of mind. And they can also create more jobs and business opportunities as a government-based public company.
create the script to cut power to USB port for 5s
/system script add name=reset_usb owner=admin dont-require-permissions=yes policy=read,write source="/system routerboard usb power-reset bus=0 duration=5s"
create a netwatch to ping 8.8.8.8 or any public ip, that will run in 5min interval, with 5s timeout and add the down-script for when the test failed
/tool netwatch add host=8.8.8.8 interval=300s timeout=5s down-script=reset_usb
$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
this is the breakdown of segments after the header.
1 220516 Time Stamp
2 A validity - A-ok, V-invalid
3 5133.82 current Latitude
4 N North/South
5 00042.24 current Longitude
6 W East/West
7 173.8 Speed in knots
8 231.8 True course
9 130694 Date Stamp
10 004.2 Variation
11 W East/West
12 *70 checksum
other than the coordinates data, everything is pretty straightforward. But now I need to convert the coordinate into standard format that's being used by google maps or any other GIS provider. refer to this
and this is how to do it
pretty basic just call the variable as a global for each thread
when running a multiprocessing sometimes there is a need to share some variable across processes
the simplest way is by using multiprocessing.Value or multiprocessing.Array
use multiprocessing.Value if the variable a simple numeric (int/double) variable, just replace 'i' (integer) into 'd' (double) as you need.
use 'c' in multiprocessing.Array if the the data is a string or a byte, for other types refer to ctypes or array module
sudo apt install -y git openssl libssl-dev \
libbz2-dev libreadline-dev libsqlite3-dev \
libffi-dev liblzma-dev
use pyenv-installer script to make our live a lil' bit easier.
curl https://pyenv.run | bash
edit your ~/.bashrc, add this 3 lines at the end of the file. what it does? this 3 lines is going to add pyenv executable to the environment PATH of the shell session and to enable autocomplete function
restart the shell session by reopening the terminal session or reload the session using this command
source ~/.bashrcinstall any python version you wanted, use this command to list all available python versions
pyenv install -l
i.e. installing python version 3.10.
pyenv install 3.10.5
it's always a good idea to create individual venv for each of your projects, i.e. making a venv named project1 based of python 3.10.5
pyenv virtualenv 3.10.5 project1
activate the venv for this shell session
pyenv shell project1
to confirm which version of the venv currently active
pyenv version
you can make the shell automagically enabled for when changing directory to specific projects folder.
cd ~/project_folder
pyenv local project1
or just enable it globally
pyenv global project1
well i am back blogging in 2022... it's been 12 years since my old blog domain expires which i am not gonna tell you the name.. LOL.
does people still blogging anyway.. most people i know who still writing are switching to medium nowadays, which i didn't particularly like. they seems..... lack personality..
anyway here i am now.. today.. STILL ALIVE !!!.. this last 2.5 years of pandemic hitting me hard last year. i didn't know if i am going to survive it, but thanks god (ALHAMDULILLAH)..
so what am i gonna do with this blog?? probably doing some documentation for anything from job related or just anything i am interested at the moment.
i think that is all i have to say for now.. so yeah... see you tomorrow for my first post.. feeling sleepy.. gonna hit the bed now..
〜( ̄▽ ̄〜)(〜 ̄▽ ̄)〜