Du bist nicht angemeldet.

#226 27.09.2017 15:26:41

hansen
Mitglied

Re: Eure brauchbarsten aliase

Was ist passiert?

Offline

#227 27.09.2017 16:15:45

Schard-nologin
Gast

Re: Eure brauchbarsten aliase

Das:

$ lftp <host> -u <user>,<passwd>
lftp <user>@<host>:~> ls              
drwxrwx---    5 1063     1064        36864 Apr 25 13:45 <folder>
drwxrwx---    2 1060     1061         4096 Sep 26 12:45 <folder>
drwxrwx---    2 1049     1049         4096 Jun 22  2016 <folder>
drwxrwx---    2 1050     1050         4096 Sep 25 04:05 <folder>
drwxrwx---    2 1059     1060         4096 Sep 19 19:02 <folder>
drwxrwx---    2 1065     1066        57344 Jun 22  2016 <folder>
drwxrwx---    2 1053     1053         4096 Jul 14 23:30 <folder>
drwxrwx---    2 1066     1067         4096 Oct 25  2016 <folder>
drwxrwxr-x    2 996      996          4096 Sep 26 23:31 <folder>
drwxrwx---    2 1062     1063         4096 Sep 26 22:28 <folder>
drwxrwx---    2 1068     1069         4096 Sep 26 23:01 <folder>
drwxrwx---    2 1067     1068         4096 May 22 12:26 <folder>
drwxrwx---    2 1064     1065         4096 Jun 22  2016 <folder>
drwxrwx---    2 1061     1062         4096 Sep 27 08:31 <folder>
lftp <user>@<host>:/> exit
$ /usr/bin/ftp <host>
Connected to <host>.
220 (vsFTPd 3.0.2)
Name (<host>:<local_user>): <user>
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
425 Failed to establish connection.
ftp> quote PASV
227 Entering Passive Mode (<ip_addr>,255,65).
ftp> ls
200 PORT command successful. Consider using PASV.
425 Failed to establish connection.
ftp> 

#228 16.11.2017 22:06:04

Werner
Mitglied

Re: Eure brauchbarsten aliase

Das kannte ich noch nicht, hab‘s heute erst entdeckt und finde es sehr praktisch.

echo "https://bbs.archlinux.de/index.php" | curl -F-=\<- qrenco.de
# Text aus Zwischenablage zu QR-Code
alias qr='echo "$(xsel -bo)" | curl -F-=\<- qrenco.de'

Offline

#229 29.11.2017 00:41:58

Kerberos
Mitglied

Re: Eure brauchbarsten aliase

Wetterbericht in der Konsole

alias wetter='curl wttr.in/München?lang=de'
alias mond='curl wttr.in/moon?lang=de'

Man kann die Ausgabe und die Abfrage von wttr.in anpassen.


Bonus
Falls man mal zu faul ist um die MAN-Pages zu wälzen:
curl cheat.sh/Befehl

 user@Rechner [~] curl cheat.sh/pacman
# All the following command work as well with multiple package names

# To search for a package
pacman -Ss <package name>

# To update the local package base and upgrade all out of date packages
pacman -Suy

# To install a package
pacman -S <package name>

# To uninstall a package
pacman -R <package name>

# To uninstall a package and his depedencies, removing all new orphans
pacman -Rcs <package name>

# To get informations about a package
pacman -Si <package name>

# To install a package from builded package file (.tar.xz)
pacman -U <file name/file url>

# To list the commands provided by an installed package
pacman -Ql <package name> | sed -n -e 's/.*\/bin\///p' | tail -n +2

# To list explicitly installed packages
pacman -Qe

# To list orphan packages (installed as dependencies and not required anymore)
pacman -Qdt


# You can't directly install packages from the Arch User Database (AUR) with pacman.
# You need yaourt to perform that. But considering yaourt itself is in the AUR, here is how to build a package from its tarball.
# Installing a package from AUR is a relatively simple process:
# - Retrieve the archive corresponding to your package from AUR website
# - Extract the archive (preferably in a folder for this purpose)
# - Run makepkg in the extracted directory. (makepkg-s allows you to install any dependencies automatically from deposits.)
# - Install the package created using pacman
# Assuming $pkgname contains the package name.
wget "https://aur.archlinux.org/packages/${pkgname::2}/$pkgname/$pkgname.tar.gz"
tar zxvf "$pkgname.tar.gz"
cd "$pkgname"
# Build the package
makepkg -s
# Install
sudo pacman -U <package file (.pkg.tar.xz)>
 user@Rechner [~] _

Offline

#230 29.11.2017 02:29:31

Gering-ding-ding-ding-din
Gast

Re: Eure brauchbarsten aliase

Werner schrieb:

Das kannte ich noch nicht, hab‘s heute erst entdeckt und finde es sehr praktisch.

echo "https://bbs.archlinux.de/index.php" | curl -F-=\<- qrenco.de
# Text aus Zwischenablage zu QR-Code
alias qr='echo "$(xsel -bo)" | curl -F-=\<- qrenco.de'

Wenn man seinen Text nicht durch Netz schicken möchte (und unabhängig von der individuellen Farbabstimmung des Terminals bleiben möchte):

$ qr2 "irgend ein text"
...
$ pacman -Qo qr2
/usr/bin/qr2 ist in python2-qrcode 5.3-3 enthalten

#231 15.05.2020 15:29:58

arch-kali-suse
Mitglied

Re: Eure brauchbarsten aliase

meine .bashrc:

export PATH="/home/user/bin:$PATH"                        
export EDITOR="/usr/bin/vim"
export GIT_EDITOR="/usr/bin/vim"                              
export HISTFILESIZE="1000"                                    
                                                              
export DNS_TYPES="a aaaa txt ns mx soa"

export ONLINE="no"    
export ONLINE_SAVE="no"
export ONLINE_IP=" 0.0.0.0"
export ONLINE="yes" #[[ "$(wget http://42.org -O - -o /dev/null|head -1)" == "<HTML><HEAD>" ]]&&export ONLINE="yes"
[[ "$(systemctl status sshd.service | grep running | wc -l)" == "0" ]]&&export ONLINE_SAVE="yes"
[[ "$ONLINE" == "yes" ]]&&export ONLINE_IP="$(wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d '<' -
f1)"        
[[ "$ONLINE" == "yes" ]]&&export ONLINE_HOSTNAME="$(dig -x $ONLINE_IP +noall +answer | awk '{print $5}')"


function dns(){                                                                                                              
        local a b                                             
        for a in "$@"                                         
        do                                                                                                                   
                for b in $DNS_TYPES                                                                                          
                do       
                        dig $b +noall +answer $a  
                done
        done
}
function ip_outside(){
        [[ "$(wget http://42.org -O - -o /dev/null|head -1)" == "<HTML><HEAD>" ]]&&wget http://checkip.dyndns.org/ -O - -o /d
ev/null | cut -d: -f 2 | cut -d '<' -f1 
}
function online_status(){
        export ONLINE="no"
        export ONLINE_SAVE="no" 
        export ONLINE_IP=" 0.0.0.0"
        [[ "$(wget http://42.org -O - -o /dev/null|head -1)" == "<HTML><HEAD>" ]]&&export ONLINE="yes"
        [[ "$(systemctl status sshd.service | grep running | wc -l)" == "0" ]]&&export ONLINE_SAVE="yes"
        [[ "$ONLINE" == "yes" ]]&&export ONLINE_IP="$(wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut 
-d '<' -f1)"

        echo "online:           $ONLINE"
        echo "online save:      $ONLINE_SAVE"
        echo "online ip:       $ONLINE_IP"
}
function unixtime(){
        while sleep 1;
        do
                clear
                date
                date +%s
        done
}
function unixtimex(){
        while sleep 1;
        do
                clear
                date
                date +%s
                sudo bash -c 'date +%s > /dev/console'
        done
}
function hist(){                                                                                                     [19/141]
        eval history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -rn | head -$1 | nl | less  
}                                                                                                                            
function weather(){                                           
        [[ "$(wget http://42.org -O - -o /dev/null|head -1)" == "<HTML><HEAD>" ]]&&curl wttr.in/$1                           
}                                                                                                                            
function weather_short(){                                                                                                    
        weather $1 2>/dev/null | head -7 | tail -5            
}                   
function random_number(){
        head -c1 /dev/urandom | od -An -vtu1 | tr -d ' '
}                     
function qrcode(){                                                                                                           
        [[ "$(wget http://42.org -O - -o /dev/null|head -1)" == "<HTML><HEAD>" ]]&&echo "$@" | curl -F-=\<- qrenco.de 
}                        
function prime_check(){        
        openssl prime $@ | sed -e "s/[()isrmeot]//g"  | awk '{print $3 " " $2}'
}                                                             
 


alias ll="ls -la"                                             
alias ls="ls --color"

alias brexit="exit"
alias vimbash="vim ~/.bashrc && . ~/.bashrc"

alias tm="tmux"

alias am="alsamixer"
alias cls=clear
alias o="less -r"

alias libreoffice="libreoffice --nologo"
alias startx="startx 2>/dev/null >/dev/null"

alias moon='weather "moon?lang=de"'

alias sudo_edit="sudo EDITOR=vim visudo"
alias wlan='ip a sh wlp2s2 | grep inet | grep -v inet6 | awk "{print \$2}"'
alias online_ip='online_status | grep ip | awk "{print \$3}"'
alias minicom="sudo minicom"
alias bashrc=". ~/.bashrc"

alias BOFH="telnet towel.blinkenlights.nl 666 2>/dev/null | tail -3 | head -2 "
alias L8="echo 'LAYER 8 PROBLEM'"

export ONLINE_HOSTNAME=$(tr '[:upper:]' '[:lower:]' <<< "$ONLINE_HOSTNAME")
export HOSTNAME_OLD=$(cat ~/bin/ip_addr)                      
if [[ "$HOSTNAME_OLD" != "$ONLINE_HOSTNAME" ]]; then
        echo "Online Hostname has changed from $HOSTNAME_OLD to $ONLINE_HOSTNAME, use certificate_update to update"
        alias certificate_update="sudo /home/$USER/bin/cert.sh $HOSTNAME_OLD $ONLINE_HOSTNAME"
fi                                                            
                                                              
if [[ ! -s ~/bin/screenfetch_tmp ]]; then      
        touch ~/bin/screenfetch_tmp                                                                                          
        ~/bin/screenfetch > ~/bin/screenfetch_tmp
fi                                                            
[[ "$(tty | head -c8)" == "/dev/tty" || "$(tty | head -c8)" == "/dev/pts" ]] && cat ~/bin/screenfetch_tmp && date
                                                              
                                                                                                                             
#sudo loadkeys de-latin1                                                                                                     
#setterm -foreground green -store -clear                                                                                     
                                                                                                                             
# syntax                                                                                                                     
# vim: ts=8 sts=8 sw=8 noet si syntax=bash

Alle Angaben Ohne Gewähr, dass sie funktionieren.

Offline

#232 15.05.2020 16:48:45

Dirk
Moderator

Re: Eure brauchbarsten aliase

Nachdem sich bei mir für Steam (installiert als Flatpak) nahezu 30 verschiedene Treibervarianten für meine Grafikkarte angesammelt haben, gibt es inzwischen diesen Alias bei mir:

$ type flatpak-update 
flatpak-update ist ein Alias von `flatpak update ; flatpak uninstall --unused'.

Damit wird nach dem Update ungenutzter Kram deinstalliert, weil Flatpak das anscheinend nicht selbst hinbekommt.

Offline

Schnellantwort auf dieses Thema

Schreibe deinen Beitrag und versende ihn
Deine Antwort

Fußzeile des Forums