-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
andriusk
committed
Nov 30, 2019
1 parent
57b6f56
commit e129281
Showing
3 changed files
with
138 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,110 @@ | ||
# bash resources main script | ||
# ln -s ~/bin/.bashrc ~/.bashrc | ||
##################################### | ||
# to reload: | ||
# . ~/.bashrc | ||
# . ~/bin/.bashrc | ||
|
||
#PS1='\w\$ ' | ||
#PS1=$(whoami)@$(hostname):$(pwd) $ | ||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] ' | ||
|
||
WINEDEBUG=-all | ||
|
||
rid='none' | ||
unamestr=`uname` | ||
if [[ "$unamestr" == 'Linux' ]]; then | ||
rid='linux' | ||
elif [[ "$unamestr" == 'Darwin' ]]; then | ||
rid='darwin' | ||
fi | ||
|
||
if [[ $rid == 'darwin' ]]; then | ||
# FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5 | ||
FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5 | ||
fi | ||
|
||
# If not running interactively, don't do anything | ||
[ -z "$PS1" ] && return | ||
|
||
echo "rid=$rid" | ||
echo "TERM=$TERM" | ||
|
||
# https://github.com/ronanguilloux/dotfiles/blob/master/.bashrc | ||
# If this is an xterm set the title to user@host:dir | ||
case "$TERM" in | ||
xterm*|rxvt*) | ||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h :>: \w\a\]$PS1" | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
if [ -f ~/.bash_aliases ]; then | ||
. ~/.bash_aliases | ||
fi | ||
# display | ||
if [ -f ~/disp.sh ]; then | ||
~/disp.sh | ||
fi | ||
|
||
# -------------------- GIT bashing -------------------- | ||
function parse_git_branch () { | ||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | ||
} | ||
|
||
RED="\[\033[0;31m\]" | ||
YELLOW="\[\033[0;33m\]" | ||
GREEN="\[\033[0;32m\]" | ||
NO_COLOUR="\[\033[0m\]" | ||
PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " | ||
|
||
# --- more aliases ---------------------- | ||
alias fuck='sudo $(history -p \!\!)' | ||
alias services='brew services' | ||
alias service='brew services list' | ||
alias totalcmd='wine c:/bin/totalcmd/totalcmd.exe &' | ||
alias wtf='tail -f /var/log/{dmesg,messages,*{,/*}{log,err}}' | ||
|
||
# PATH ........ | ||
# Node.js | ||
# export PATH=$HOME/local/bin:$PATH | ||
# Android | ||
# export PATH=/home/ronan/Bin/android-sdk-linux_x86/tools:${PATH} | ||
# export PATH=/home/ronan/Bin/android-sdk-linux_x86/platform-tools:${PATH} | ||
# akeneo author dot files | ||
# https://github.com/ronanguilloux/dotfiles/blob/master/.bash_aliases | ||
|
||
# alias fastips='for ip in $(seq 1 20); do echo "1.$ip" && ping -c 1 -W 0.5 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || :; done' | ||
# alias ips ='for ip in $(seq 1 254); do echo "1.$ip" && ping -c 1 -W 0.5 192.168.1.$ip ; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || :; done' | ||
# alias allIps='for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done' | ||
# Add an "alert" alias for long running commands. Use like so: | ||
# # sleep 10; alert | ||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | ||
# alias wtf='tail -f /var/log/{dmesg,messages,*{,/*}{log,err}}' | ||
|
||
alias ..="cd .." | ||
alias ...="cd ../.." | ||
|
||
alias la='ls -la' | ||
alias l='ls -la' | ||
# alias lsd='ls -h --color --group-directories-first' | ||
alias lsa='ls -A' # affiche les fichiers cachés | ||
alias ll='ls -lh' # affiche en mode liste détail | ||
|
||
alias semaine='date +%V' | ||
alias ifif='sudo ifdown wlan0 && sudo ifup wlan0' | ||
alias screencast='ffmpeg -f x11grab -r 25 -s wxga -i :0.0 /tmp/outputFile.mpg' | ||
|
||
#git | ||
alias gpo='git push origin ' | ||
alias gs='git status' | ||
# View HTTP traffic | ||
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'" | ||
|
||
# sdk | ||
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! | ||
export SDKMAN_DIR="/Users/andriusk/bin/.sdkman" | ||
[[ -s "/Users/andriusk/bin/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/andriusk/bin/.sdkman/bin/sdkman-init.sh" | ||
# bash resources main script | ||
# ln -s ~/bin/.bashrc ~/.bashrc | ||
##################################### | ||
# to reload: | ||
# . ~/.bashrc | ||
# . ~/bin/.bashrc | ||
|
||
#PS1='\w\$ ' | ||
#PS1=$(whoami)@$(hostname):$(pwd) $ | ||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] ' | ||
|
||
# macOs iTerm2 problem with Alt key: | ||
# Cmd+., Profiles, Keys and choose Left option Key acts as: +Esc. | ||
|
||
WINEDEBUG=-all | ||
rid='none' | ||
unamestr=`uname` | ||
if [[ "$unamestr" == 'Linux' ]]; then | ||
rid='linux' | ||
elif [[ "$unamestr" == 'Darwin' ]]; then | ||
rid='darwin' | ||
fi | ||
|
||
if [[ $rid == 'darwin' ]]; then | ||
# FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5 | ||
FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5 | ||
fi | ||
|
||
# If not running interactively, don't do anything | ||
[ -z "$PS1" ] && return | ||
|
||
echo "rid=$rid" | ||
echo "TERM=$TERM" | ||
|
||
# https://github.com/ronanguilloux/dotfiles/blob/master/.bashrc | ||
# If this is an xterm set the title to user@host:dir | ||
case "$TERM" in | ||
xterm*|rxvt*) | ||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h :>: \w\a\]$PS1" | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
if [ -f ~/.bash_aliases ]; then | ||
. ~/.bash_aliases | ||
fi | ||
# display | ||
if [ -f ~/disp.sh ]; then | ||
~/disp.sh | ||
fi | ||
|
||
# -------------------- GIT bashing -------------------- | ||
function parse_git_branch () { | ||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | ||
} | ||
|
||
RED="\[\033[0;31m\]" | ||
YELLOW="\[\033[0;33m\]" | ||
GREEN="\[\033[0;32m\]" | ||
NO_COLOUR="\[\033[0m\]" | ||
PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " | ||
|
||
# --- more aliases ---------------------- | ||
alias fuck='sudo $(history -p \!\!)' | ||
alias services='brew services' | ||
alias service='brew services list' | ||
alias totalcmd='wine c:/bin/totalcmd/totalcmd.exe &' | ||
alias wtf='tail -f /var/log/{dmesg,messages,*{,/*}{log,err}}' | ||
|
||
# PATH ........ | ||
# Node.js | ||
# export PATH=$HOME/local/bin:$PATH | ||
|
||
# Android | ||
# export PATH=/home/ronan/Bin/android-sdk-linux_x86/tools:${PATH} | ||
# export PATH=/home/ronan/Bin/android-sdk-linux_x86/platform-tools:${PATH} | ||
# akeneo author dot files | ||
# https://github.com/ronanguilloux/dotfiles/blob/master/.bash_aliases | ||
|
||
# alias fastips='for ip in $(seq 1 20); do echo "1.$ip" && ping -c 1 -W 0.5 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || :; done' | ||
# alias ips ='for ip in $(seq 1 254); do echo "1.$ip" && ping -c 1 -W 0.5 192.168.1.$ip ; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || :; done' | ||
# alias allIps='for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done' | ||
# Add an "alert" alias for long running commands. Use like so: | ||
# # sleep 10; alert | ||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | ||
|
||
alias ..="cd .." | ||
alias ...="cd ../.." | ||
|
||
alias la='ls -la' | ||
alias lsd='lsd -d */' | ||
alias l='ls -la' | ||
# alias lsd='ls -h --color --group-directories-first' | ||
alias lsa='ls -A' # affiche les fichiers cachés | ||
alias ll='ls -lh' # affiche en mode liste détail | ||
|
||
alias semaine='date +%V' | ||
# alias ifif='sudo ifdown wlan0 && sudo ifup wlan0' | ||
# alias screencast='ffmpeg -f x11grab -r 25 -s wxga -i :0.0 /tmp/outputFile.mpg' | ||
#git | ||
alias gpo='git push origin ' | ||
alias gs='git status' | ||
# View HTTP traffic | ||
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'" | ||
|
||
# sdk | ||
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! | ||
# export SDKMAN_DIR="/Users/andriusk/bin/.sdkman" | ||
# [[ -s "/Users/andriusk/bin/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/andriusk/bin/.sdkman/bin/sdkman-init.sh" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
#!/bin/bash | ||
# | ||
# . ~/bin/.profile | ||
|
||
export PATH="/usr/bin:/opt/local/bin:/opt/local/sbin:$PATH" | ||
# Finished adapting your PATH environment variable for use with MacPorts. | ||
# set PATH so it includes user's private bin if it exists | ||
if [ -d "$HOME/bin" ] ; then | ||
PATH="$HOME/bin:$PATH" | ||
fi | ||
|
||
# export | ||
PATH="/usr/bin:/opt/local/bin:/opt/local/sbin:$PATH" | ||
|
||
# MacPorts Installer addition was: | ||
# export PATH="/opt/local/bin:/opt/local/sbin:$PATH" | ||
# Finished adapting your PATH environment variable for use with MacPorts. | ||
cat /etc/issue | tail -n 2 | ||
whoami | ||
ip addr show | grep "inet 19" | ||
echo "$PATH=" $PATH | tail -n 1 | ||
|
||
# . ~/bin/.bashrc | ||
if [ -n "$BASH_VERSION" ]; then | ||
# include ~/bin/.bashrc if it exists, when shell is BASH | ||
if [ -f "$HOME/bin/.bashrc" ]; then | ||
. "$HOME/bin/.bashrc" | ||
fi | ||
# restore BASH prompt PS1 | ||
PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " | ||
|
||
# if [ | ||
# . ~/bin/bash_osx | ||
# fi | ||
fi |
This file contains 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