domenica 14 dicembre 2014

intel_pstate and set frequency

Since with Ubuntu 14.10 intel_pstate is loaded by default and superseded the old acpi control, my old trick to reduce the frequency of CPU didn't work anymore so I couldn't cool down the processors while running some demanding software (and prevent overheating).

So bad.

Instead of disabling intel_pstate as suggested by some, I digged into the issue and found that
sudo cpupower frequency-set -u 1300MHz
works as expected (and indeed it doesn't block the frequency to a level but only sets an upper limit!).

So good!

Move app to sd - Android

Since my Zenithink C97 (yes it's old, but hey it's working and has Christian Troy's Cyanogen 11  onboard!) has only 1GB of internal memory and a very hungry Angry Birds Go! were sitting on 800MB (app+data) of that memory, I needed to move the game to SD.
Unfortunately the button Move To SD was disabled. So I tried a few app (app2sd), without luck
At the end that worked:

~$ sudo adb devices
$ adb shell pm set-install-location 2 

Then rebooted the phone and.... tada! Move To SD button was enabled.
Now plenty of space!

Note: Sudo was needed because if adb daemon starts without root privileges, the system complained that
????????? no permissions

Thanks to http://techgage.com/article/moving_your_non-movable_android_apps_to_an_sd_card/

mercoledì 19 novembre 2014

Find duplicate images (link)

Here some ways to clean up the filesystem, finding (and destroying eheheheh) duplicate images hunting your hard drive.
The first method in this brilliant post let you even learn the bash!
http://www.linux.com/learn/tutorials/774031-how-to-sort-and-remove-duplicate-photos-in-linux
Just in the case the post would be deleted:
find Pictures/  -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 15 > dupes.txt
Duplicates filenames and empty lines are in dupes.txt
$ awk 'NF != 0 {++count} END {print count}' dupes.txt
9855
Count duplicates
$ awk '/^$/{getline;print;}' dupes.txt |wc -l
4301
fdupes -rSm Pictures/
5554 duplicate files (in 4301 sets), occupying 41484.8 megabytes


fdupes counts the same as awk (9855-4301==5554)


Now please reckon and tell me how many hundreds of megabytes (and viruses) you have to install to perform such a task on Windoz!

Sorrow p*rn


From the comment, the expression sorrow p*rn covers so many fact nowadays
http://amazingatheist.tumblr.com/post/102550084836


i3 How to get window classes and other useful infos (link)

Here you go, i.e. at faq.i3wm.org (useful to have gnome-calculator to appear in floating mode, since when tiled it looks horrible)

find key names for i3

Wondering what to write as key name in .i3/config file?
Easy (not guessed myself, found at faq.i3wm.org, comment #3)

xev

(press the key)

read the keycode, remember Shift doesn't change anything, just add  "Shift+" to bindsym key


xmodmap -pke|grep 220

You'll get something like
keycode 220 = XF86WebCam NoSymbol XF86WebCam
Then you can use the keycode name in .i3/config
bindsym XF86WebCam exec "scrot -q 100 -e 'mv $f ~/Pictures/screenshots'" 

i3 my config file (for my asus k53)

There's a brilliant tiling window manager, that loads in a second or two, that's not overbloated, that's fast, that let you simply work and be productive. That's how things should be done and software coded!
It's i3

Here's my config file, for your (and my!) convenience

# This file has been auto-generated by i3-config-wizard(1).# It will not be overwritten, so edit it as you like.## Should you change your keyboard layout somewhen, delete# this file and re-run i3-config-wizard(1).#
# i3 config file (v4)## Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font# is used in the bar {} block below. ISO 10646 = Unicodefont -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1# The font above is very space-efficient, that is, it looks good, sharp and# clear in small sizes. However, if you need a lot of unicode glyphs or# right-to-left text rendering, you should instead use pango for rendering and# chose a FreeType font, such as:# font pango:DejaVu Sans Mono 10font pango: M+ 1m, FontAwesome, 10
# Use Mouse+$mod to drag floating windows to their wanted positionfloating_modifier $mod
# start a terminalbindsym $mod+Return exec i3-sensible-terminal
# kill focused windowbindsym $mod+Shift+q kill
# start dmenu (a program launcher)bindsym $mod+p exec dmenu_run# There also is the (new) i3-dmenu-desktop which only displays applications# shipping a .desktop file. It is a wrapper around dmenu, so you need that# installed.# bindsym $mod+D exec --no-startup-id i3-dmenu-desktop
# change focus#bindsym $mod+j focus left#bindsym $mod+m focus down#bindsym $mod+i focus up#bindsym $mod+k focus right
# alternatively, you can use the cursor keys:bindsym $mod+Left focus leftbindsym $mod+Down focus downbindsym $mod+Up focus upbindsym $mod+Right focus right
# move focused window#bindsym $mod+Shift+j move left#bindsym $mod+Shift+k move down#bindsym $mod+Shift+l move up#bindsym $mod+Shift+colon move right
# alternatively, you can use the cursor keys:bindsym $mod+Shift+Left move leftbindsym $mod+Shift+Down move downbindsym $mod+Shift+Up move upbindsym $mod+Shift+Right move right
# split in horizontal orientationbindsym $mod+h split h
# split in vertical orientationbindsym $mod+v split v
# enter fullscreen mode for the focused containerbindsym $mod+f fullscreen
# change container layout (stacked, tabbed, toggle split)bindsym $mod+s layout stackingbindsym $mod+w layout tabbedbindsym $mod+e layout toggle split
# toggle tiling / floatingbindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windowsbindsym $mod+space focus mode_toggle
# focus the parent containerbindsym $mod+a focus parent
# focus the child container#bindsym $mod+d focus child
# switch to workspacebindsym $mod+1 workspace 1bindsym $mod+2 workspace 2bindsym $mod+3 workspace 3bindsym $mod+4 workspace 4bindsym $mod+5 workspace 5bindsym $mod+6 workspace 6bindsym $mod+7 workspace 7bindsym $mod+8 workspace 8bindsym $mod+9 workspace 9bindsym $mod+0 workspace 10
# move focused container to workspacebindsym $mod+Shift+1 move container to workspace 1bindsym $mod+Shift+2 move container to workspace 2bindsym $mod+Shift+3 move container to workspace 3bindsym $mod+Shift+4 move container to workspace 4bindsym $mod+Shift+5 move container to workspace 5bindsym $mod+Shift+6 move container to workspace 6bindsym $mod+Shift+7 move container to workspace 7bindsym $mod+Shift+8 move container to workspace 8bindsym $mod+Shift+9 move container to workspace 9bindsym $mod+Shift+0 move container to workspace 10
# reload the configuration filebindsym $mod+Shift+c reload# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)bindsym $mod+Shift+r restart# exit i3 (logs you out of your X session)bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)mode "resize" {        # These bindings trigger as soon as you enter the resize mode
        # Pressing left will shrink the window’s width.        # Pressing right will grow the window’s width.        # Pressing up will shrink the window’s height.        # Pressing down will grow the window’s height.        #bindsym j resize shrink width 10 px or 10 ppt        #bindsym k resize grow height 10 px or 10 ppt        #bindsym l resize shrink height 10 px or 10 ppt        #bindsym semicolon resize grow width 10 px or 10 ppt
        # same bindings, but for the arrow keys        bindsym Left resize shrink width 10 px or 10 ppt        bindsym Down resize grow height 10 px or 10 ppt        bindsym Up resize shrink height 10 px or 10 ppt        bindsym Right resize grow width 10 px or 10 ppt
        # back to normal: Enter or Escape        bindsym Return mode "default"        bindsym Escape mode "default"}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status# finds out, if available)bar {        status_command i3status # status_command measure-net-speed-i3status.bash         #status_command i3status+ #workspace_buttons yes #position bottom mode dock #tray_output primary colors {        background #000000        statusline #999999        focused_workspace  #ffffff #285577        active_workspace   #ffffff #333333        inactive_workspace #888888 #222222        urgent_workspace   #ffffff #900000    }}
workspace_auto_back_and_forth yesbindsym $mod+z workspace back_and_forth
bindsym XF86AudioRaiseVolume exec amixer -D pulse -q set Master 5%+ unmute && killall -SIGUSR1 i3statusbindsym XF86AudioLowerVolume exec amixer -D pulse -q set Master 5%- unmute && killall -SIGUSR1 i3statusbindsym XF86AudioMute exec amixer -D pulse -q set Master toggle && killall -SIGUSR1 i3statusbindsym XF86Calculator exec gnome-calculatorfor_window [class='(?i)Gcalctool'] floating enable
exec /usr/bin/parcellite &exec xbacklight -set 50 &exec dunst &
# Make the currently focused window a scratchpadbindsym $mod+m move scratchpad# Show the first scratchpad windowbindsym $mod+i scratchpad showbindsym $mod+Shift+igrave floating disable

bindym $mod+l exec "~/bin/lockscreen.sh"#exec xautolock -time 15 -locker "~/bin/lockscreen.sh" &

#Touchpad tooglebindsym XF86TouchpadToggle exec "synclient TouchpadOff=$(synclient | awk '/TouchpadOff/ {print ($3+1)%2}')"
#Snapshot entire screenbindsym XF86WebCam exec "scrot -q 100 -e 'mv $f ~/Pictures/screenshots'"bindsym XF86Launch1 exec "scrot -s -q 100 -e 'mv $f ~/Pictures/screenshots'"
#File Manager and other goodiesbindsym $mod+d exec pcmanfmbindsym $mod+g exec google-chromebindsym $mod+o exec libreoffice


#custom window settingsassign [class="^Google-chrome$"] 1assign [class="^URxvt$"] 2for_window [class="^Google-chrome$"] border none


Here's .i3status.conf
# i3status configuration file.# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.# The following line should contain a sharp s:# ß# If the above line is not correctly displayed, fix your editor first!
general {        colors = true        interval = 5 output_format = i3bar}
order += "disk /home"order += "disk /"order += "wireless wlan1"order += "ethernet eth1"order += "battery 0"order += "load"order += "cpu_temperature 0"order += "cpu_usage"order += "volume master"order += "tztime local"
wireless wlan1 {        format_up = "W: (%quality at %essid) %ip"        format_down = "W: down"}
ethernet eth1 {        # if you use %speed, i3status requires root privileges        #format_up = "E: %ip" format_up = "E: %ip"        format_down = "E: down"}
battery 0 {        format = "%status %percentage %remaining"}
run_watch DHCP {        pidfile = "/var/run/dhclient*.pid"}
run_watch VPN {        pidfile = "/var/run/vpnc/pid"}
tztime local {        format = "%d-%m-%Y %H:%M:%S"}
load {        format = "Δ: %1min %5min" max_threshold = 2}
disk "/" {        format = "%avail"}
cpu_temperature 0 { format = "± %degrees °C" max_threshold = 70}
cpu_usage { format = "%usage"}
volume master { format = "♪: %volume" format_muted = " %volume" device = "default" mixer = "Master" mixer_idx = 0}

venerdì 14 novembre 2014

volumio - write logs to ram

Found somewhere on the internet that changing permissions to transientlog is required in order to have logs written to ram memory with our beloved volumio. This reduces the use of your SD card.
 chmod +x /etc/init.d/transientlog
Then reboot

BTW: Michelangelo is seeking for funds for fizzly! Go ahead and fund him!

domenica 9 novembre 2014

Synology ssh passwordless: look at the permissions!

I bought a new Synology DS214SE after my beloved Maxtor Axis Central (with custom firmware) apparently has become too old to serve me as it should (a long story).
I tried to set up a passwordless, key-based authentication to the NAS, with no success.
I modified /etc/ssh/sshd_config
enabling what should be modified.
Then googled a while, then read the useful Zarino Zappia's post. No luck.

Anyway I eventually found a solution :

cd /var/services/homes/
chmod 755 admin

solved (as suggested here on superuser.com)

sabato 12 aprile 2014

dropbox_uploader.sh requires stat which is in package...

to know which package stat belongs to
 dpkg -S stat |grep bin|sort|less

it isn't bash....

(solution: coreutils)


Reason of the search was that Maxtor nas' custom firmare has no coreutils installed, but it has ipkg)


credits: http://newbiedoc.sourceforge.net/tutorials/apt-get-intro/info.html and me