:) bikulov.ORG Static notes about information technologies
Posts with the tag bash:

Hybrid symmetric-asymmetric encryption for large files

Assymetric encryption is useful if you want to encrypt data at remote server via script. In case you use bash script for symmetric encryption job, you have to store password inside this script. So, if remote server is compromized, you will loose both the encrypted data and the key to decrypt it. Assymetric encryption allows you not to store decryption key at remote machine. So, data will be in safe even if server is hacked.

Using CUDA C++ functions in Python via `*.so` and ctypes

I’d like to show how to use HPC part written on C++ with CUDA in Python code. So, every heavy part may be done on GPU with CUDA, all gluing tasks (with beautiful matplotlib plots) are done on CPU with Python.

Universal screen capturing with scrot, imagemagick and ffmpeg

You can record your screen using only command line in Linux. Workflow will look like: Create a bunch of screenshots -> Crop screenshots -> Make a movie from images.

Tools for tracing a pcap file in linux bash

Pcap files are pocket capture files. They usually contain raw log of network connections and packets. It is the most popular format and it available in almost all network analysis tool.

Show N biggest directories in linux bash

du (disk usage) utility in linux bash summarizes disk usage of each directory or file. By default, it outputs only directories. Just enter some dir and type

$ du ./

Toggling string case in linux bash

It’s quite an academic task, but anyway useful sometimes. I’ve collected different ways to do it in terminal in linux. Some of them work with UTF-8 characters (some it will toggle case for “й”, “ё” and so on. It will not in general handle special ligatures, such as “ß”" and “fi”.)

Montage png into single one

Glue several png’s into one png [1]+[2]+[3]+[4] = [[1][2][3][4]] with montage from ImageMagick:

montage -geometry +1+1 -tile 4x1 image*.png final.png