Posts

Showing posts from May, 2019

Convert time acces log of Squid

  tail -f /var/log/squid3/access.log | grep "192.168.0.1" | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'

My .conkyrc

  -- commentaires conky.config = { alignment = 'top_right', background = false, border_width = 1, color1 = ffffff, color2 = ffffff, color3 = C12420, draw_borders = false, draw_graph_borders = false, draw_outline = false, draw_shades = false, double_buffer = true, draw_shades = false, draw_outline = false, draw_borders = false, extra_newline = false, --[[ gap_x = 10, gap_y = 80,]] no_buffers = true, out_to_console = false, out_to_stderr = false, own_window_class = Conky, own_window = true, own_window_transparent = true, own_window_argb_visual = true, own_window_type = 'normal', own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', stippled_borders = 0, use_spacer = 'none', update_interval = 1.0, use_xft = true, xftfont = wareebook, } conky.text = [[ INFORMATIONS SYSTEME ${color3}${font caviar dreams:size=9:bold} Hôte :$alignr$nodename Uptime :$alignr$uptime PROCESSEURS ${color3}${font caviar dreams:size

Send mail with from on Linux

  Send mail from mailx -r user@domain.local -s "test send mail" user@domain.dist Send mail if connection root echo "Connection shell root:" `date` `who`| mail -s "`hostname` - connection shell root" destMail Send mail if command fail commande.sh || mail -s "command failed X" destMail

Create volume LVM

  Create a partition on a disk empty parted -s /dev/sdb mklabel msdos parted -s /dev/sdb mkpart primary 1MiB 90% Create a volume LVM on partition pvcreate /dev/sdb1 vgcreate NameVolVg /dev/sdb1 lvcreate -n NameVolLog -l 100%VG NameVolVg Format mkfs.xfs /dev/mapper/NameVolVg-NameVolLog

Usage sed

  Insert a line (2nd line) sed -i -e "2i\test-insertion-line" name-file Delete a line begin sed -i -e '/^test-insertion-line/d' Delete comment lines in file sed -e '/^[ ]*#/d' -e '/^$/d' file.txt > file.new