Skip to content

Instantly share code, notes, and snippets.

@strezh
strezh / git_save_tree.md
Created November 20, 2023 08:20
git: save all changed file tree between versions

Get tree of changed files between versions and save it to TAR archive

git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id | xargs tar -rf mytarfile.tar
  1. git diff-tree -r $commit_id: - Take a diff of the given commit to its parent(s) (including all subdirectories, not just the top directory).
  2. --no-commit-id --name-only: - Do not output the commit SHA1. Output only the names of the affected files instead of a full diff.
  3. --diff-filter=ACMRT: - Only show files added, copied, modified, renamed or that had their type changed (eg. file → symlink) in this commit. This leaves out deleted files.
@strezh
strezh / 1605711107.json
Created July 2, 2023 17:28
karabiner kb switching (caps - EN, cmd+caps - RU, ctrl+caps - GE
{
"title": "switch English, Russian",
"rules": [
{
"description": "Use caps switch language to English, left_shift+caps - Russian, left_control+caps - Georgian",
"manipulators": [
{
"from": {
"key_code": "caps_lock"
},
#!/bin/bash
# install homebrew (https://brew.sh/)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# basic software
brew install \
iterm2 \
mc \
google-chrome \
@strezh
strezh / git_remove_submodule.md
Created July 3, 2017 09:12
Git: remove submodule

To remove a submodule you need to:

  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes git add .gitmodules
  3. Delete the relevant section from .git/config.
  4. Run git rm --cached path_to_submodule (no trailing slash).
  5. Run rm -rf .git/modules/path_to_submodule
  6. Commit git commit -m "Removed submodule "
  7. Delete the now untracked submodule files
  8. rm -rf path_to_submodule
@strezh
strezh / install.md
Created March 27, 2017 13:23
Install python TA-Lib
@strezh
strezh / gist:196f183b97537a1b15bc40d3f78cbb2b
Created March 21, 2017 13:40
Vivado HLS crti.o not found
$> export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
$> vivado_hls
@strezh
strezh / config
Created February 21, 2017 14:49
moc config (add to ~/.moc/)
# This is a configuration file for the MOC player. It should be named 'config'
# and placed in directory ~/.moc/
# Comments begins with '#'.
# You can use quotes and escape ('\') in parameters
# Show file titles (title, author, album) instead of file names.
ReadTags = yes
# Directory in which you store music files, if you specify it, you will be able
# to quickly go to this directory with the '-m' parameter or the 'm' command.
@strezh
strezh / i3blocks.conf
Created February 21, 2017 14:42
i3 config (add to ~/.i3/)
separator_block_width=14
#[disk-root]
#label=:
#command=/usr/share/i3blocks/disk /
#interval=30
#color=#1793D1
#[disk-home]
#label=:
@strezh
strezh / i3blocks.conf
Created February 21, 2017 14:42
i3 config (add to ~/.i3/)
separator_block_width=14
#[disk-root]
#label=:
#command=/usr/share/i3blocks/disk /
#interval=30
#color=#1793D1
#[disk-home]
#label=:
@strezh
strezh / notebookConfig.md
Last active February 10, 2017 11:22
Configure jupyter (ipython) notebook

For error:

socket.error: [Errno 99] Cannot assign requested address

  1. Create default config

jupyter notebook --generate-config

  1. In file ~/.jupyter/jupyter_notebook_config.py set parameter