Skip to content

Commit

Permalink
debian10 profile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andriusk committed Nov 30, 2019
1 parent 57b6f56 commit e129281
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 125 deletions.
218 changes: 110 additions & 108 deletions .bashrc
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"
32 changes: 27 additions & 5 deletions .profile
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
13 changes: 1 addition & 12 deletions myip.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
#!/bin/bash

export n=9
<<<<<<< HEAD
# echo $argv
if [ $1="-f" ]; then
=======

if [[ $1 = '-n' ]]; then
export n=$2
fi

if [[ $1 = "-f" ]]; then
>>>>>>> origin/master
export n=30
# else
fi

<<<<<<< HEAD
if [ $n=9 ]; then
echo "~/bin/myip.sh:"
fi
=======
# https://linuxize.com/post/bash-if-else-statement/
# echo [ $argv 0=$0 1=$1 2=$2 n=$n ]
if [ $n -eq 8 ]; then
echo "~/bin/myip.sh:"
fi

>>>>>>> origin/master
printf "\n My external IP address: \e[1m"
curl -s http://ipecho.net/plain

Expand All @@ -41,9 +34,6 @@ ip addr show en0 | grep inet
# colors prinft: [34 - blue, 31-red 35m - Magenta 92 -lt green 37m - lt gray
# \e[0m reset \e1m - bold
printf " \n"
<<<<<<< HEAD
~/bin/screenfetch-dev | head -n $n
=======

if [ -f ~/bin/screenfetch-dev ]; then
~/bin/screenfetch-dev | head -n $n
Expand All @@ -52,7 +42,6 @@ else
./screenfetch-dev | head -n $n
fi

>>>>>>> origin/master
printf "\n\e[0m"

# bash ~/bin/myip.sh -f > ~/index.html
Expand Down

0 comments on commit e129281

Please sign in to comment.