Search This Blog

2020-12-04

setuid reminder

"Linux ignores the setuid¹ bit on all interpreted executables (i.e. executables starting with a #! line)."

2020-09-29

programming us keyboard layout with pt characters

!! ~/.xmodmaprc

  !! make AltGr to switch mode

keycode 108 = Mode_switch

  !! Programming keys

keycode 34 = bracketleft braceleft parenleft less
keycode 35 = bracketright braceright parenright greater

keycode 18 = 9 parenleft less
keycode 19 = 0 parenright greater degree

  !! Acentuação e sinais auxiliares

  ! A Á À Â Ã   Á Â
  ! E É - Ê -   É Ê
  ! I Í - - -   Í À  *
  ! O Ó - Ô Õ   Ó Ô 
  ! U Ú - - -   Ú Õ  *

  ! C - - - -   Ç Ã  *

  ! note: use caps lock to select case.

keycode 38 = a A aacute acircumflex
keycode 26 = e E eacute ecircumflex 
keycode 31 = i I iacute agrave
keycode 32 = o O oacute ocircumflex
keycode 30 = u U uacute otilde

keycode 54 = c C ccedilla atilde

  !! primeir@ :: º and ª

keycode 48 = quoteright quotedbl masculine ordfeminine

  !! « » at < >

keycode 59 = comma less guillemotleft
keycode 60 = period greater guillemotright

  !! r R ® ©

keycode 27 = r R registered copyright

  !! Superiors

  ! 1 ! ¹
  ! 2 @ ²
  ! 3 # ³

keycode 10 = 1 exclam onesuperior
keycode 11 = 2 at twosuperior
keycode 12 = 3 numbersign threesuperior

  !! Currency :: 4 $ € £

keycode 13 = 4 dollar EuroSign sterling

  !! αβit

keycode 90 = KP_Insert KP_0 Greek_alpha
keycode 91 = KP_Delete KP_Decimal Greek_beta

test if directory is empty ... :)

https://stackoverflow.com/questions/91368/checking-from-shell-script-if-a-directory-contains-files

https://superuser.com/questions/352289/bash-scripting-test-for-empty-directory

https://www.cyberciti.biz/faq/linux-unix-shell-check-if-directory-empty/

# ?O.o ... well ::: dash/bash only... :)

[ "`echo *`" = '*' -a "`echo **`" = '**' ] && {
  echo has no public files ;
  [ "`echo .*`" = '.*' -a "`echo .**`" = '.**' ] &&
    echo also has no hidden files, is empty ;
} ;

there it is ... :)

# example of use ... :)

cdl ()  # cd and maybe list
{
  local owd="`pwd`" ;
  cd "$@" &&  {
    [ "$owd" = "`pwd`" ] ||
    # actually changed directory,
      [ "`echo *`" = '*' \
      -a "`echo **`" = '**' ] ||
        # has public files,
        { echo ; .ls ; }  # list them.
  };
} ;

2020-09-24

keyboard tips...

https://wiki.debian.org/Keyboard

http://xahlee.info/linux/linux_keybinding_index.html

https://unix.stackexchange.com/questions/249122/why-do-my-xmodmap-binds-involving-altgr-only-work-on-some-keys

& there you go update...

xmodmap -e 'keycode 108 = Mode_switch' ;

xmodmap -e "keycode 34=bracketleft braceleft parenleft less"

xmodmap -e "keycode 35=bracketright braceright parenright greater"