Bash (GNU Bourne-Again SHell) the default shell for many Linux distributions. It is very common for scripting languages in Linux. Bash is easy and straightforward for writing small tools. However, as most tools, it has its grammars that could easily cause bugs if they are not used correctly. Here I summarize a list of good
Read more
Tag: How to
How to Install Wine 32-bit on CentOS 8
Posted onSince version 7, RHEL and CentOS only have 64 bit versions. For some reasons, it’s better to run many Windows applications under 32 bit wine. Like How to Install Wine 32-bit on CentOS 7, this post introduce how to install 32-bit Wine on CentOS 8. Most of the mechanisms are similar yet there are differences.
Read more
How to Convert Integers to Strings and Strings to Integers in PHP
Posted onConversion from integer to string and from string to integer are common operations in most applications such as C++. PHP has its uniqueness in language and standard library design. In this post, we will check methods to convert integers to strings and vice versa. Convert string to int in PHP You can cast a string
Read more
How to list and start VirtualBox VMs in command line in Linux?
Posted onVirtualBox is a nice open source virtual machine software. It works nicely on Linux and is supported by many Linux distros like Ubuntu in their official package repositories, so it is quite easy to set it up on Linux. The VMs can also be managed in command line using the vboxmanage command line tool provided
Read more
Adding Gmail SMTP in Thunderbird
Posted onGmail’s authentication is secured by rejecting access from less secure apps. By default, adding Gmail SMTP in Thunderbird with your Google account password as SMTP authentication password will not work. And Google is beginning to shut off Google Account access to less secure apps. To solve this, the method is to use OAuth2 authentication instead
Read more
How to synchronize OneDrive and OneDrive for Business files in Linux using Insync
Posted onOneDrive is one of the good cloud storage services available and there is a business version called OneDrive for Business. Microsoft’s Office 365 plan is widely used including Exchange Email service and OneDrive for Business. However, there is no official client released yet for Linux users. Insync is a third party cloud storage syncing software
Read more
How to list all commits in a git repository
Posted on`git log` only list all the commits in the current working branch. For some cases, we may want to list all the commits in a git repository. The `git log` command does not do this. But there are other supports in `git` that can do so. The command to list all commits is git rev-list
Read more
Generating a Pair of RSA Private and Public Keys in Linux using OpenSSL
Posted onRSA (Rivest–Shamir–Adleman) is a widely used public-key cryptosystem that is used for secure communication over the internet. In this post, we will explore how to generate a pair of RSA private and public keys in Linux using the OpenSSL library. Generating a pair of RSA private and public keys in Linux using OpenSSL is a
Read more
How to encrypt a file using openssl on Linux non-interactively?
Posted onHow to encrypt a file using openssl on Linux non-interactively? The passphrase shall be provied to openssl in a programmatic way instead of requesting the user to input it, so that the command may work in a regular cron job or some batch jobs. To encrypt file file.tgz and store it to file.tgz using aes-256-ebc
Read more
Synchronizing Thunderbird Calendar and Address Book with Office365 Exchange Online using ActiveSync
Posted onThunderbird is a nice email client available on Linux and Windows. With the Lightning plugin, Thunderbird can support calendar functions well. Exchange is a widely used email and calendar/address book service software. Office 365 provide the cloud version of Exchange named Office 365 Exchange Online. Although Exchange Online provide IMAP for synchronizing emails, it provides
Read more
How to Make iPhone with iOS 13 Faster
Posted onAfter the recent iOS upgrading to version 13, many older iPhones such as iPhone 8 turn to be running slower, although there are many new features. New features and functions use more CPU/GPU/memory and the iOS may run slower. But are there any methods to make it run faster? After quite some research and testing,
Read more
What Are the Secrets Behind Google’s Success Story?
Posted onGoogle has created an image that tells us its core values are centered around innovation. There are very few companies that can boast a similar level of influence as Google. Nevertheless, we should not only focus on Google’s achievements today but also learn from their journey to the top. We can break down Google’s core
Read more
How to generate a pair of SSH private key and public key pairs?
Posted onHow to generate a pair of SSH private key and public key pairs? On Linux, you can generate one first by $ ssh-keygen -t rsa By default on Linux, the key pair is stored in `~/.ssh` named `id_rsa` and `id_rsa.pub` for the private and public key.
How to cat a text file out from a tar archive without having to extracting it?
Posted onHow to cat a text file out from a compressed tar archive package without having to extracting the whole package? For example, I have a pkg.tar.gz which contains a text file pkg/readme.txt in it. How to cat the pkg/readme.txt file content out? You may use this command to cat out the file content: tar -O
Read more
How to Change Windows User Name on Windows 10 Using Computer Management
Posted onThe Windows user name can be changed according to the user’s needs and requirement. The Windows 10 Windows Settings tool interface keeps changing after updates. It is a little hard to find out the tool to do the user name changing. One way to change Windows user name is to do it through the Computer
Read more
How to mirror a website using wget on Linux?
Posted onHow to mirror a website using wget on Linux? If the command can filter only specific file extensions, such as pdf and docx, it will be much better too. To download all PDF files from https://example.org/path/ as an example, you may use this command: wget –mirror \ –convert-links –no-parent –quiet \ –adjust-extension -A pdf \
Read more
How to Statically Link OCaml Programs
Posted onStatic linking is preferred for some cases although it has its own various problems. Static building/linking is not always possible for some languages on some platform. For OCaml, the answer to this question is yes. In this post, we will introduce 2 methods to statically linking OCaml: static linking with runtime glibc required and static
Read more
How to write to remote side with sudo in rsync?
Posted onHere is the case, the user can not write directly to the remote side’s directory, while the user can sudo on the remote side and write the directory with sudo. How to write to remote side with sudo in rsync? On the source machine, run the rsync command with –rsync-path="sudo rsync" added. For example, rsync
Read more
How to write file content with sudo in Vim?
Posted onVim opens file even if the user does bot have write permission to the file. But after revision, how to write file content with sudo in Vim if Vim reports no permission to write the file. Use this command inside of vim to write to the file with sudo: :w !sudo tee % Here, !
Read more
How to limit shared AWS EC2 accounts’ access to view and start all VMs yet stop only certain VMs
Posted onIf a team with many accounts share and manages the virtual machines under that same AWS accounts, it is a common practice to limit AWS EC2 accounts’ access to view or start all VMs yet stop only certain VMs. For example, one account has 50 VMs tagged “prod” while 25 VMs tagged “dev”. The developers
Read more