GithubHelp home page GithubHelp logo

echuraev__dotfiles's Introduction

My dotfiles

This repository included almost all my configurations for different programs on Linux and Mac OS.

Installation

Just clone this repository to your home directory

Configurations

Environment configurations

By default my .bashrc will check if zsh is installed then zsh will be started in oposit case you will work in bash. Your personal config you should write to .bashrc.global or .bashrc.local. In global file all settings will be in all your configurations. In local file there is settings only for specific machine.

GDB Dashboard

Usially I use Vim and Conque GDB plugin for debug. But sometimes when I don't like to run Vim bui I want to have nice looking GDB, I use GDB Dashboard. Just copy .gdbinit to your home directory.

Ripgrep

It is really fast. See here: https://github.com/BurntSushi/ripgrep

Vim

I use VIM as my primary text editor. My Vim configuration with description you can find here. It works on Linux, Mac and Windows.

Zsh

In zsh I use zplug as my plugins manager. Also I use vim mode for editing commands.

Some tips

Linux

Problem with headphones on Ubuntu 16.04

It was no sound in headphones on Ubuntu 16.04. I found solution here. I added to the end of the /etc/modprobe.d/alsa-base.conf the following line:

options snd-hda-intel model=generic

If after reboot headphones are not working, try to kill pulseaudio: pulseaudio -k.

Setup working with several monitors

For configuring my displays I use xrandr utility. Below is example of configuration. Put this command line to ~/.xprofile.

xrandr --output HDMI-1 --mode 1920x1200 --pos 0x0 --output HDMI-2 --mode 1920x1200 --pos 1921x0 --output VGA-1 --mode 1280x1024 --pos 3842x0

Mac OS

Auto-mount NTFS volumes in read-write mode

I found this information here: https://github.com/osxfuse/osxfuse/wiki/NTFS-3G

Short instruction:

  1. Install NTFS-3G from Homebrew: brew install ntfs-3g

  2. Replace /sbin/mount_ntfs with the version provided by NTFS-3G. May be it will not be possible due System Integrity Protection. So, you have to disable it.

    You need to reboot your mac and press โŒ˜+R when booting up. Then go into Utilities > Terminal and type the following commands:

    csrutil disable
    reboot
    
  3. To replace Apple's NTFS mount tool with the one provided by NTFS-3G execute the following commands in Terminal. This will back up the original mount tool to /Volumes/Macintosh HD/sbin/mount_ntfs.orig.

    sudo mv "/Volumes/Macintosh HD/sbin/mount_ntfs" "/Volumes/Macintosh HD/sbin/mount_ntfs.orig"
    sudo ln -s /usr/local/sbin/mount_ntfs "/Volumes/Macintosh HD/sbin/mount_ntfs"
    
Manage your Mac Applications

I found very nice application that can help you to manage your Apps (e.g. total remove an application): https://nektony.com/mac-app-uninstaller

Manage windows

For managing my windows I use the following tool: https://github.com/eczarny/spectacle It is really comfortable and useful.

Configure gdb

I found instruction on this gist: https://gist.github.com/danisfermi/17d6c0078a2fd4c6ee818c954d2de13c And from this answer: https://stackoverflow.com/questions/49001329/gdb-doesnt-work-on-macos-high-sierra-10-13-3/49104154#49104154

echuraev__dotfiles's People

Contributors

echuraev avatar

Watchers

pcdlynn avatar

echuraev__dotfiles's Issues

Could I ask you one weird problem I met with?

I use your part of gdbinit and made small changes

shell test -e /tmp/colorPipe && rm /tmp/colorPipe

# no need to remove if append something because this is fifo
shell mkfifo /tmp/colorPipe

shell test -e ~/.gdb-color-pipe && rm ~/.gdb-color-pipe
shell mkfifo ~/.gdb-color-pipe
set logging overwrite on


define setup-color-pipe
    # shell rm -f ~/.gdb-color-pipe
    # shell touch ~/.gdb-color-pipe
    set logging redirect on
    set logging enabled on
    # set logging file /tmp/colorPipe
    set logging file ~/.gdb-color-pipe
end

define cleanup-color-pipe
    set logging enabled off
    set logging redirect off
    shell sleep 0.2
    # shell rm -f ~/.gdb-color-pipe
end

document cleanup-color-pipe
    Disables command redirection and removes the color pipe file.
    Syntax: cleanup-color-pipe
end

define do-generic-colors
    # 1. Function names and the class they belong to
    # 2. Function argument names
    # 3. Stack frame number
    # 4. Thread id colorization
    # 5. File path and line number

    # shell cat ~/.gdb-color-pipe | \
    shell cat ~/.gdb-color-pipe | \
        sed -r "s_([^<])(\b([a-zA-Z0-9_]+::)?[a-zA-Z0-9_\.@]+)( ?)\(_\1$(tput setaf 6)$(tput bold)\2$(tput sgr0)\4(_g" | \
        sed -r "s_([a-zA-Z0-9_#]*)=_$(tput setaf 2)$(tput bold)\1$(tput sgr0)=_g" | \
        sed -r "s_^(#[0-9]*)_$(tput setaf 1)$(tput bold)\1$(tput sgr0)_" | \
        sed -r "s_^([ \*]) ([0-9]+)_$(tput bold)$(tput setaf 6)\1 $(tput setaf 1)\2$(tput sgr0)_" | \
        sed -r "s_(\.*[/A-Za-z0-9\+_\.\-]*):([0-9]+)\$_$(tput setaf 4)\1$(tput sgr0):$(tput setaf 3)\2$(tput sgr0)_" &
end

define hook-backtrace
    setup-color-pipe
end

define hookpost-backtrace
    do-generic-colors
    cleanup-color-pipe
end

######################## borrowed from you and modified begin from here.

set disassembly-flavor intel

define hook-list
shell cat /tmp/colorPipe | pygmentize -lcpp -O style=solarized-light&
set logging redirect on
set logging enabled on 
set logging file /tmp/colorPipe
end

define hookpost-list
set logging enabled off
set logging redirect off
# must wait for the pygmentize to return
shell sleep 0.2
end

define hook-quit
shell rm -f /tmp/colorPipe
shell rm -f ./.gdb-color-pipe
end

define re
hookpost-disassemble
echo \033[0m
end
document re
Restore colorscheme
end

in gdb if use list can output things but use bt stuck there

>>> list 4
1       /*
2        * 2.89.c
3        */
...
>>> bt

but then in bash outside run can get output

$ cat ./.gdb-color-pipe |         sed -r "s_([^<])(\b([a-zA-Z0-9_]+::)?[a-zA-Z0-9_\.@]+)( ?)\(_\1$(tput setaf 6)$(tput bold)\2$(tput sgr0)\4(_g" |         sed -r "s_([a-zA-Z0-9_#]*)=_$(tput setaf 2)$(tput bold)\1$(tput sgr0)=_g" |         sed -r "s_^(#[0-9]*)_$(tput setaf 1)$(tput bold)\1$(tput sgr0)_" |         sed -r "s_^([ \*]) ([0-9]+)_$(tput bold)$(tput setaf 6)\1 $(tput setaf 1)\2$(tput sgr0)_" |         sed -r "s_(\.*[/A-Za-z0-9\+_\.\-]*):([0-9]+)\$_$(tput setaf 4)\1$(tput sgr0):$(tput setaf 3)\2$(tput sgr0)_"
#0  main (argc=1, argv=0x7fffffffd858) at 2.89.c:43

maybe the entire do-generic-colors didn't run which is weird.

czg:~$ ps aux | grep sed
root        1885  0.0  0.0 172612 11352 ?        Ssl  16:00   0:00 /usr/sbin/cups-browsed
czg        21550  0.0  0.0  12304  2280 pts/16   S+   17:33   0:00 grep --color=auto sed
czg:~$ ps aux | grep pygme
czg         4703  0.0  0.0  26252 12716 ?        S    16:03   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg         6067  0.0  0.0  26252 12660 ?        S    16:05   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg         6199  0.0  0.0  26252 12724 ?        S    16:06   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg         9041  0.0  0.0  26252 12772 ?        S    16:18   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg         9438  0.0  0.0  26252 12724 ?        S    16:18   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg        21025  0.0  0.0  26252 12700 ?        S    17:31   0:00 /usr/bin/python3 /usr/local/bin/pygmentize -lcpp -O style=solarized-light
czg        21554  0.0  0.0  12304  2300 pts/16   S+   17:33   0:00 grep --color=auto pygme
czg:~$ ps aux | grep cat
root         214  0.0  0.0      0     0 ?        I<   16:00   0:00 [kworker/u33:0-rb_allocator]
root         635  0.0  0.0      0     0 ?        I<   16:00   0:00 [kworker/u33:2-rb_allocator]
czg         2353  0.0  0.1 2934336 27668 ?       Sl   16:00   0:00 /usr/bin/gjs /usr/share/gnome-shell/org.gnome.Shell.Notifications
czg         2402  0.0  0.0 252940 11444 ?        Ssl  16:00   0:00 /usr/libexec/gsd-print-notifications
czg         2484  0.1  1.2 1169824 199728 ?      Sl   16:00   0:06 /snap/snap-store/638/usr/bin/snap-store --gapplication-service
czg         4702  0.0  0.0  11468  1020 ?        S    16:03   0:00 cat /tmp/colorPipe
czg         5060  0.0  0.0  18184  1864 ?        S    16:04   0:00 cat
czg         5061  0.0  0.0  18184  1860 ?        S    16:04   0:00 cat
czg         6066  0.0  0.0  11468  1016 ?        S    16:05   0:00 cat /tmp/colorPipe
czg         6198  0.0  0.0  11468  1028 ?        S    16:06   0:00 cat /tmp/colorPipe
czg         9040  0.0  0.0  11468  1112 ?        S    16:18   0:00 cat /tmp/colorPipe
czg         9437  0.0  0.0  11468  1028 ?        S    16:18   0:00 cat /tmp/colorPipe
czg        21024  0.0  0.0  11468  1012 ?        S    17:31   0:00 cat /tmp/colorPipe
czg        21764  0.0  0.0  12304  2336 pts/16   S+   17:37   0:00 grep --color=auto cat

Is there one method to see detailed what gdb has done like set -v -x -T in bash?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.