wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz
tar zxvf Python-3.9.4.tgz
cd Python-3.9.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#-----------------------------# | |
# Example content of .gpg file: | |
# declare -a a=(01 02 03 04 05) | |
# declare -a b=(01 02 03 04 05) | |
# declare -a c=(01 02 03 04 05) | |
# declare -a d=(01 02 03 04 05) | |
# .... | |
# Usage: santa a1 e4 j2 | |
#-----------------------------# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i3 config file (v4) | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
# Set mod key (Mod1=<Alt>, Mod4=<Super>) | |
set $mod Mod4 | |
# set default desktop layout (default is tiling) | |
# workspace_layout tabbed <stacking|tabbed> | |
# Configure border style <normal|1pixel|pixel xx|none|pixel> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Unfortunately on aws Amazon Linux distribution Tmux version is bit outdated (1.8) | |
# Here is solution how you can get more recent version (3.0a available in dic 2019) | |
sudo yum install libevent-devel ncurses-devel | |
wget https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a.tar.gz | |
cd tmux-3.0a/ | |
./configure | |
make | |
sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -iname "*.webm" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3";' _ '{}' \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# map test without lambda | |
python3 -mtimeit -s'xs=range(10)' 'map(hex, xs)' | |
python3 -mtimeit -s'xs=range(10)' '[hex(x) for x in xs]' | |
# map lambda test | |
python3 -mtimeit -s'xs=range(10)' 'map(lambda x: x+2, xs)' | |
python3 -mtimeit -s'xs=range(10)' '[x+2 for x in xs]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple java class to get file extension. | |
* Returns null if file starts with point, like .htaccess, and if the file don't have any extension. | |
* Created by Sergio Marchenko on 05-05-2017. | |
*/ | |
public class ExtensionChecker { | |
public static String getFileExtension(String fileName) { | |
if (!fileName.startsWith(".") && fileName.contains(".")) { | |
return fileName.substring(fileName.lastIndexOf(".") + 1); | |
} |