Recently, I registered a private limited company in Sri Lanka. My experience was surprisingly smooth. I could do all the paperwork online. Almost all the documents are generated via the online system called EROC. Payments can be done by cards too. They have given a detailed guide too. But drafting the article of association wasn’t that straightforward. Some guidelines can ...
I love thinkorswim platform. It is really great to go through the market data and fundamentals. Recently, thinkorswim had an issue on displaying decimal places. It looked like below. It can be fixed by changing font settings. Click Setup -> Application Settings on the right top corner. Click on the Look and Feel. Then tick the Use system font. Click ...
I wanted to develop a CLI tool using boto3. If MFA is enabled, it will keep asking for a token every time application tries to create a new session. It is a bit annoying to enter the token every time. I found a way to reuse the credential cache. We will need both boto3 and botocore modules. boto3 no longer ...
I wanted to develop a CLI tool using boto3. If MFA is enabled, it will keep asking for a token every time application tries to create a new session. It is a bit annoying to enter the token every time. I found a way to reuse the credential cache. We will need both boto3 and botocore modules. boto3 no longer ...
Have you ever gotten this error when you are trying to export huge tables using mysqldump? mysqldump: Error 1969: Query execution was interrupted (max_statement_time exceeded) when dumping table `table_name` at row: 999999999 You can try using the --quick option. It exported more than double the amount of records, but still failed with the same error. $ mysqldump --quick database_name table_name ...
Have you ever gotten this error when you are trying to export huge tables using mysqldump? mysqldump: Error 1969: Query execution was interrupted (max_statement_time exceeded) when dumping table `table_name` at row: 999999999 You can try using the --quick option. It exported more than double the amount of records, but still failed with the same error. $ mysqldump --quick database_name table_name ...
If you stop unused RDS instances, it will start in 7 days. It is easy, if you have one instance, you can manage manually. When you have 100s of database instances, it is a bit difficult to stop them manually. If you create a lambda function with a weekly EventBrigde (CloudWatch Events) trigger, it will keep the instances stopped.
If you stop unused RDS instances, it will start in 7 days. It is easy, if you have one instance, you can manage manually. When you have 100s of database instances, it is a bit difficult to stop them manually. If you create a lambda function with a weekly EventBrigde (CloudWatch Events) trigger, it will keep the instances stopped.
Using 3rd party Github actions on your projects can be dangerous. Tags can be changed afterward.[1] It might be time-consuming to go through a published action that might take more time. Even if you write custom actions yourself, in a separate repository, you need to publish them in a public repository, for now, to use in a workflow. Workaround for ...
Using 3rd party Github actions on your projects can be dangerous. Tags can be changed afterward.[1] It might be time-consuming to go through a published action that might take more time. Even if you write custom actions yourself, in a separate repository, you need to publish them in a public repository, for now, to use in a workflow. Workaround for ...
ansible is the only module needed for this script. If you don’t need to specify vault_id, below code would work. from ansible.parsing.vault import VaultEditor, VaultSecret vault_password = 'vault_password123' secret_value = 'super_secret_123' vault_id = None encrypted_secret = VaultEditor().encrypt_bytes(secret_value, VaultSecret(bytes(vault_password, 'utf-8')), vault_id=vault_id).decode("utf-8") encrypted_text = 'secret_token: !vault |\n ' + encrypted_secret.replace('\n', '\n ') print(encrypted_text) Omits
ansible is the only module needed for this script. If you don’t need to specify vault_id, below code would work. from ansible.parsing.vault import VaultEditor, VaultSecret vault_password = 'vault_password123' secret_value = 'super_secret_123' vault_id = None encrypted_secret = VaultEditor().encrypt_bytes(secret_value, VaultSecret(bytes(vault_password, 'utf-8')), vault_id=vault_id).decode("utf-8") encrypted_text = 'secret_token: !vault |\n ' + encrypted_secret.replace('\n', '\n ') print(encrypted_text) Omits
I don’t like using subprocess that often. Using subprocess to invoke curl instead of using requests is not how you should use it. But there are valid exceptions. Below example, I write to the stdin and then read stdout and stderr. from subprocess import Popen, PIPE try: command = ["awk", "-F ", "{print $2}"] process = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE, ...
I don’t like using subprocess that often. Using subprocess to invoke curl instead of using requests is not how you should use it. But there are valid exceptions. Below example, I write to the stdin and then read stdout and stderr. from subprocess import Popen, PIPE try: command = ["awk", "-F ", "{print $2}"] process = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE, ...
I wanted to create a PrivateBin note with Python. It looks so easy at a glance. But request has to be encrypted properly. Luckily, I found this python repository https://github.com/r4sas/PBinCLI. I stripped out things needed for creating post. You might need below dependencies to be installed in order to make it work. requests base58 pycryptodome
I wanted to create a PrivateBin note with Python. It looks so easy at a glance. But request has to be encrypted properly. Luckily, I found this python repository https://github.com/r4sas/PBinCLI. I stripped out things needed for creating post. You might need below dependencies to be installed in order to make it work. requests base58 pycryptodome
I wanted to build and install coreutils on a Ubuntu server. You will be probably fine with the stable release of coreutils that comes with Ubuntu. First I had to install the tools needed for the build. $ sudo apt update $ sudo apt install build-essential \ autoconf \ automake \ autopoint \ bison \ gperf \ texi2html \ texinfo ...
I wanted to build and install coreutils on a Ubuntu server. You will be probably fine with the stable release of coreutils that comes with Ubuntu. First I had to install the tools needed for the build. $ sudo apt update $ sudo apt install build-essential \ autoconf \ automake \ autopoint \ bison \ gperf \ texi2html \ texinfo ...
In the new Ubuntu version, you cannot change /etc/resolv.conf. You can change it. But it won’t last a restart. It will be replaced by systemd-resolved. I wanted to change the domain name and DNS/nameserver. If you look at man 8 systemd-resolved, you can see you have to change a different file called /etc/systemd/resolved.conf. Please change your resolved.conf file accordingly. My ...
In the new Ubuntu version, you cannot change /etc/resolv.conf. You can change it. But it won’t last a restart. It will be replaced by systemd-resolved. I wanted to change the domain name and DNS/nameserver. If you look at man 8 systemd-resolved, you can see you have to change a different file called /etc/systemd/resolved.conf. Please change your resolved.conf file accordingly. My ...