10 paź 2016

git caching password

git >= 1.7.10




git config --global credential.helper cache


# timeout 1h

git config --global credential.helper 'cache --timeout=3600'

26 wrz 2016

for x in $(ls) - poprawka, spacje

# poprawa listowania plików ze spacjami w nazwie
OIFS="$IFS"
IFS=$'\n'

for x in $(ls) ; do ...; done

:)

powrót:

IFS="$OIFS"

23 wrz 2016

bash

do_something 2>&1 | tee -a some_file
This is going to redirect stderr to stdout and stdout to some_file and print it to stdout.

8 wrz 2016

Banana pi SD -> SATA

mke2fs -t ext4 -L rootfs /dev/sda1
mkdir /tmp/sata
mount /dev/sda1 /tmp/sata
rsync -arx --progress / /tmp/sata


mount /dev/mmcblk0p1 /boot


apt-get install u-boot-tools

cd /boot
nano boot.cmd

# root=/dev/sda1

mkimage -C none -A arm -T script -d boot.cmd boot.scr
reboot

16 cze 2016

pgp mutt

Zaufanie:
gpg --trusted-key 0x... --list-keys 0x...
lub
gpg --edit-key 0x... trust


.muttrc
my_hdr X-PGP-Key: http://example.com/pubkey.asc
pobieranie:
gpg --recv-keys 0x...
lub
gpg --search-keys  0x...


13 cze 2016

zsh compile

./configure --enable-maildir-support --enable-function-subdirs --enable-site-fndir=/usr/local/share/zsh/site-functions --enable-fndir=/usr/share/zsh/functions --with-tcsetpgrp --enable-cap --enable-pcre --enable-readnullcmd=pager -enable-custom-patchlevel=Debian LDFLAGS="-Wl,--as-needed -g"

8 cze 2016

perltidy

perltidy -i=3 -bl -lp -cti=1 -pt=2 -sbt=2 -bt=2 -bbt=2 -nsfs -nsts -nwls="+ - / *" -nwrs="+ - / *" -l=1000 -syn -sfp -ibc tutocos.pl

29 maj 2016

keyboard keys map udev

spis klawiszy : https://hal.freedesktop.org/quirk/quirk-keymap-list.txt

Odczytanie kodu klawiszy
# /lib/udev/keymap -i input/event0

zapisać nową mapę klawiszy:

/lib/udev/keymaps/lenovo-t430byne

0xC7 delete
0xCF insert
0xD2 end
0xD3 home
0x3A screenlock


mapowanie po starcie:
/etc/rc.local
/lib/udev/keymap input/event0 /lib/udev/keymaps/lenovo-t430byne &

12 maj 2016

debian wheezy freezing unless mouse move/click

/etc/default/grub ...


Test -
GRUB_CMDLINE_LINUX_DEFAULT="quiet pci=nommconf idle=poll"
- failed!

Test -
GRUB_CMDLINE_LINUX_DEFAULT="quiet nolapic_timer clocksource=jiffies"
- failed!

Test -
GRUB_CMDLINE_LINUX_DEFAULT="quiet nohz=off"
- works!

11 maj 2016

hdparm spindown standby

info:

hdparm -I /dev/sdb | grep level
hdparm -B /dev/sdb

ustawienie czasu uśpienia dysku:

Zakresy:

x= od 1 do 240        (x *5sec)
x= od 241 do 251    (245-x)*30min

przykład:
hdparm -S 50 /dev/sdb = uśpienie po  50*5 sec
sudo hdparm -S 242 /dev/sdb = uśpienie po (242-240)*30 min.



do ustawienia w /etc/hdparm.conf

14 kwi 2016

xmpp send

aptitude install libloudmouth1-dev

/usr/share/doc/libloudmouth1-dev/examples/lm-send-async.c.gz

gcc -o lm-send-async lm-send-async.c `pkg-config --cflags --libs loudmouth-1.0`

./lm-send-async --server moj.net --username ten@moj.net --password haselko \
 --fingerprint "xx" \
 --recipient tamten@moj.net --message "RUCHY!"



7 kwi 2016

256 colors

Xterm:
export TERM=xterm-256color

Tmux (config)
set -g default-terminal "screen-256color"


Vim (config)
set t_Co=256

check: &t_Co

25 lut 2016

Multiboot USB CD linux cmd



http://multicd.us/  
( git clone git://github.com/IsaacSchemm/MultiCD.git )
+
image-usb-stick
( git clone https://github.com/abock/image-usb-stick.git )

Clever.

1 sty 2016

suspend fluxbox wheezy not authorized

vi /etc/polkit-1/localauthority/50-local.d/org.freedesktop.suspend.pkla

....
[Re-enable suspend by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=yes
....

add ~/.fluxbox/startup

....
ck-launch-session xfce4-power-manager --no-daemon &
....