Autocomplete from the history in terminal

create a file .inputrc in your home directory and put there "\e[A": history-search-backward "\e[B": history-search-forward set show-all-if-ambiguous on set completion-ignore-case on # display possible completions using different colors to indicate their file types set colored-stats On TAB: menu-complete Restart your terminal. Now you can autocomplete from history using Up and Down keys. Source

June 2, 2016 · SergeM

Working with date and time in Java (russian)

Часть 1: https://habrahabr.ru/post/274811/ Часть 2: https://habrahabr.ru/post/274905/

June 1, 2016 · SergeM

About python

Production Database helpers for sqlalchemy Backend-agnostic database creation (CREATE IF NOT EXISTS): 1 2 if not database_exists('postgres://postgres@localhost/name'): create_database('postgres://postgres@localhost/name') Possible with SQLAlchemy-Utils library. See docs Infrastructure with Python http://dustinrcollins.com/infrastructure-with-python – list of tools for python development Retry libraries for python tenacity - a fork of retrying. Seems alive and powerful. retrying - abandoned but popular project. backoff Language Cheat Sheet: Writing Python 2-3 compatible code http://python-future.org/compatible_idioms.html Google Python Guidelines https://google.github.io/styleguide/pyguide.html Inheritance https://rhettinger....

May 1, 2016 · SergeM

Dropbox in linux mint

Hmm. It doesn’t work. I see the icon when i do dropbox stop dropbox start but I cannot click on it. Installed nemo-dropbox. At least now I have “Copy dropbox link” command in menu. Don’t forget to do $ killall nemo after installation to make it work. Final Solution source Use dropbox stop && dbus-launch dropbox start Or Do: opening ‘Preferences’ -> ‘Startup Applications’ and editing the dropbox entry so the command now reads:...

April 10, 2016 · SergeM

C++ IDE for linux

UPD: It seems that the current solution (2019) is VSCode. It’s free and powerful. There is a plenty of plugins. VSCode How to see content of std::string in the debugger You have to enable pretty printing by default for gdb, Add the following to your launch.json: "setupCommands": [ { "text": "-enable-pretty-printing" } ] Using CMake in VSCode See C++ and CMake Clion CLion is awesome but expensive. Codelite Found Codelite on http://stackoverflow....

April 5, 2016 · SergeM

Debugging numpy (any C code of Python) using gdb

I created a tiny python script that executes some python code, that executes some C code: # contents of dbg_broadcast.py import numpy print list(numpy.broadcast([[1,2]],[[3],[4]])) Running in console: > gdb python GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. .................. bla bla bla .................................................. # Adding breakpoint to function "arraymultiter_new" (example): (gdb) break arraymultiter_new # There is name completition by Tab....

April 4, 2016 · SergeM

convert video to jpeg with good quality

convert video to jpeg with good quality: 1 avconv -i input_video.mp4 -qmax 1 -qmin 1 images_%05d.jpg crop video: 1 avconv -i input.avi -vf crop=<width>:<height>:<x>:<y> output_%05d.png create gif using http://gifmaker.me/

December 14, 2015 · SergeM

Operations with lists in Java

Initializa list: 1 List<String> names = Arrays.asList("Bob", "John", "Alice");

December 12, 2015 · SergeM

Free PDF Editor for Linux

Looks good for linux mint/ Ubuntu https://code-industry.net/free-pdf-editor/

October 30, 2015 · SergeM

Keyboard layout switching. Toggle between 2 of 3 languages.

Let’s say you have 3 languages on your linux machine: English, Russian and Belarusian. You frequently switch between EN and RU. Sometimes you write something in EN and BY. So you don’t want to press Alt+Shift three times constantly, only when writting something in Belarusian. 1 2 3 4 5 6 7 8 9 10 11 #!/bin/bash current=`setxkbmap -query | grep layout|cut -d ',' -f 2` echo $current if [ "$current" == "by" ] then notify-send -t 500 -i keyboard "Keyboard layouts: US/RU" setxkbmap -model pc105 -layout us,ru -variant altgr-intl, -option grp:alt_shift_toggle else notify-send -t 500 -i keyboard "Keyboard layouts: US/BY" setxkbmap -model pc105 -layout us,by -variant altgr-intl, -option grp:alt_shift_toggle fi Here I assume that Alt+Shift switches languages inside a group....

October 18, 2015 · SergeM