Generating a Pair of RSA Private and Public Keys in Linux using OpenSSL

Posted on

RSA (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 on

How 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

How to mirror a website using wget on Linux?

Posted on

How 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 get date and time from another timezone in Python?

Posted on

How to get the date and time from another timezone in Python? You may use the pytz library. Example usage as follows. $ python3 Python 3.8.2 (default, Jul 16 2020, 14:00:26) >>> from datetime import datetime >>> import pytz >>> >>> print(datetime.now(pytz.timezone(‘Europe/Amsterdam’)).strftime(‘%Y-%m-%d %H:%M:%S %Z%z’)) 2020-08-09 15:50:00 CEST+0200 >>>

How to enable user themes in Ubuntu 18.04?

Posted on

The way for Ubuntu 17 to installing the gnome-shell-extensions package does not work any more for Ubuntu 18.04. How to enable user themes in Ubuntu 18.04? The updated gnome-shell-extensions package actually adds the User Theme extension back. You can use that. First, install the package sudo apt install gnome-shell-extensions Second, log out and login again
Read more

How to get date and time using date command from another timezone in Linux?

Posted on

date command on Linux gets the date and time in the system timezone. But how to get date and time using date command from another timezone in Linux? You can make date print the time of another timezone by setting the TZ environment variable. For example, export TZ=Hongkong; date Sat Dec 1 09:39:13 HKT 2018
Read more

How to change the logo shown during booting in Ubuntu?

Posted on

How to change the logo shown during booting in Ubuntu? I originally installed Ubuntu MATE 18.04. But I am using GNOME 3 now by replacing the DE. But the log shown during booting is still Ubuntu MATE’s. How to change it to another one? It is plymouth the application that manages the “splash” screen during
Read more

GNOME 3 "Natural scrolling" mouse option does not work

Posted on

In GNOME 3 “Settings” -> “Devices” -> “Mouse & Touchpad”, after setting “Natural scrolling” to On, the scrolling is still as the same before (non-natural). How to fix this? This is likely related to the X11 driver. Remove the xorg-x11-drv-synaptics driver if it is installed. And install the xorg-x11-drv-libinput driver if it is not installed.
Read more

How to add Chinese input method to Unbuntu 18.04?

Posted on

How to add Chinese input method, such as Pinyin, to Unbuntu 18.04? To input Chinese, first install an input method framework. Here, we use fcitx. Then you need to input the Pinyin input method. You may use fcitx-sunpinyin. Put them all together $ sudo apt-get install fcitx fcitx-sunpinyin After that, set the default input method
Read more

How to filter bbpress content in WordPress

Posted on

In WordPress, we can filter the post content by adding a filter to the_content: add_filter('the_content', 'inline_markdown_pre_process_shortcode2', 7); But how to filter the content for bbpress contents? bbpress topic and reply (they are separated) content have their own filters: bbp_get_topic_content and bbp_get_reply_content. For example, add_filter(‘bbp_get_topic_content’, ‘my_plugin_custom_bbp_function’); add_filter(‘bbp_get_reply_content’, ‘my_plugin_custom_bbp_function’); function my_plugin_custom_bbp_function($content) { return ‘my_plugin_custom_bbp_function processed: ‘.$content; }