vimrc

this is a little vimrc that is just about right for small purposes..

(edit the file ~/.vimrc for user specific changes and /etc/vimrc?? for systemwide configuration)

syntax on
filetype indent plugin on

set autoindent
set smartindent

set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4

set number
set background=light
set smartcase
set cursorline

explanation:

  • smartcase searches smart:
    /copyright      " Case insensitive
    /Copyright      " Case sensitive
    /copyright\C    " Case sensitive
    /Copyright\c    " Case insensitive
  • indentation:
    • autoindent: same as line before
    • smartindent: does some thinking (one level deeper for “if else”, etc.)
  • cursorline:
    • highlights current line of cursor position
  • The command zc will close a fold (if the cursor is in an open fold), and zo will open a fold (if the cursor is in a closed fold). It’s easier to just use za which will toggle the current fold (close it if it was open, or open it if it was closed).The commands zc (close), zo (open), and za (toggle) operate on one level of folding, at the cursor. The commands zC, zO and zA are similar, but operate on all folding levels (for example, the cursor line may be in an open fold, which is inside another open fold; typing zC would close all folds at the cursor).The command zr reduces folding by opening one more level of folds throughout the whole buffer (the cursor position is not relevant). Use zR to open all folds.The command zm gives more folding by closing one more level of folds throughout the whole buffer. Use zM to close all folds.

sources:

Advertisements

arch: pacman automatic download

This little post explains how to enable download for packages of pacman. It uses a systemd service.

Create the download service (note the option -w for just downloading the packages):

$ sudo vim /etc/systemd/system/pacman-downloader.service
[Unit]
 Description=Automatic Update
 After=network-online.target 

[Service]
 Type=simple
 ExecStart=/usr/bin/pacman -Syuwq --noconfirm
 TimeoutStopSec=180
 KillMode=process
 KillSignal=SIGINT

[Install]
 WantedBy=multi-user.target

Create a timer service to launch the downloader:

$ sudo vim /etc/systemd/system/pacman-downloader.timer
[Unit]
 Description=Automatic Update when booted up after 5 minutes then check the system for updates every 60 minutes

[Timer]
 OnBootSec=5min
 OnUnitActiveSec=60min
 Unit=pacman-downloader.service

[Install]
 WantedBy=multi-user.target

Enable and start the service using systemctl.


Source-link: www.techrapid.co.uk

edit zsh prompt

  1. append to .zshrc in home folder to import file:
    $ vim ~/.zshrc
    ...
    source .zshrc-prompt
  2. create .zshrc-prompt in home dir:
    $ cat .zshrc-prompt 
    # Prompt format: [USER@MACHINE:DIRECTORY] [TIME] \n →;
    
    # create bold fonting+color
    PROMPT="%{$terminfo[bold]$fg[green]%}[%{$fg[yellow]%}"
    
    # username@MACHINE:
    # %n username
    # %M machine
    PROMPT="$PROMPT%n@%M:"
    
    # directory
    # %~ directory and $HOME is repalced by ~
    PROMPT="$PROMPT$fg[blue]%}%~"
    
    # color stuff
    PROMPT="$PROMPT%{$fg[green]%}]%{$reset_color%}"
    
    # add time
    PROMPT="$PROMPT%{$terminfo[bold]$fg[black]%} [%*]"
    
    # add 2nd line
    PROMPT="$PROMPT
    %{$terminfo[bold]$fg[white]%}→ %{$reset_color%}"
    
  3. do same for root (same as (1)):
    $ vim /root/.zshrc
    ...
    source .zshrc-prompt
  4. similar to (2):
    $ cat /root/.zshrc-prompt 
    # Prompt format: [USER@MACHINE:DIRECTORY] [TIME] \n #;
    
    # create bold fonting+color
    PROMPT="%{$terminfo[bold]$fg[green]%}[%{$fg[red]%}"
    
    # username@MACHINE:
    # %n username
    # %M machine
    PROMPT="$PROMPT%n@%M:"
    
    # directory
    # %~ directory and $HOME is repalced by ~
    PROMPT="$PROMPT$fg[blue]%}%~"
    
    # color stuff
    PROMPT="$PROMPT%{$fg[green]%}]%{$reset_color%}"
    
    # add time
    PROMPT="$PROMPT%{$terminfo[bold]$fg[black]%} [%*]"
    
    # add 2nd line
    PROMPT="$PROMPT
    %{$terminfo[bold]$fg[red]%}# %{$reset_color%}"
    

FAHO printer

  1. install samba + smbclient (arch wiki)
  2. install cups + hplip (arch wiki)
  3. install printers:
    1. choose samba printers
    2. set path: smb://<name>:<pw>@sylvester/{hp4100,hp3525}
    3. install drivers: pcl3 NOT postscript
      • color hp3525:
        • official name: HP Color LaserJet CP3525 Printer
        • driver name: HP -> Color LaserJet cp3525 -> HP Color LaserJet CP3525 pcl3
        • duplex: installed
      • black-white hp4100:
        • official name: HP LaserJet 4100
        • driver: HP LaserJet 4100 pcl3
        • duplex: installed

Install Tipp10 under debian-based distros

Install the 10-finger practice-typing program “Tipp10”. It features addaptive lessons concerning indiviual typing errors, and much more..

  1. install 32-bit libraries:
    $ sudo apt-get install  libXcursor1:i386  libsm6:i386  libxrandr2:i386  libxi6:i386   libxinerama1:i386  libfreetype6:i386  libfontconfig1:i386  libglib2.0-0:i386  libstdc++6:i386
  2. download current version from their website: https://www.tipp10.com/en/download/getfile/5/
  3. install:
    $ sudo dpkg -i <Path/to/file.deb>

    Source:

    https://wiki.ubuntuusers.de/Schreibtrainer/

Install Firefox-Next (beta) on Mint, Ubuntu, Debian, etc…

  1. Add mozilla ppa:
    $ sudo add-apt-repository ppa:mozillateam/firefox-next
  2. get the ppa’s origin name (bold):
    $ apt-cache policy
    ...
     500 http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu/ trusty/main Translation-en
     500 http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu/ trusty/main i386 Packages
         release v=14.04,o=LP-PPA-mozillateam-firefox-next,a=trusty,n=trusty,l=Official PPA for Firefox Beta,c=main
         origin ppa.launchpad.net
     500 http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu/ trusty/main amd64 Packages
         release v=14.04,o=LP-PPA-mozillateam-firefox-next,a=trusty,n=trusty,l=Official PPA for Firefox Beta,c=main
         origin ppa.launchpad.net
    ...
  3. Pinn the mozilla ppa for higher priority:
    $ cat /etc/apt/preferences.d/firefox-beta-pin-800
    Package:  *
    Pin: release o=LP-PPA-mozillateam-firefox-next
    Pin-Priority: 800
    
  4. update/upgrade:
    $ sudo apt update && sudo apt upgrade

    Sources:

http://www.webupd8.org/2011/05/firefox-5-beta-channel-ubuntu-ppa.html

http://askubuntu.com/questions/170235/how-do-i-cherry-pick-packages-from-a-ppa