domingo, 9 de abril de 2017

Linux: Nova instància de Dropbox

Serveix bàsicament per tenir una altra instància de Dropbox a part de la que ja tenim.
Extret de: http://stackoverflow.com/questions/37380829/how-to-multiple-dropbox-instances-in-linux

Open a terminal and paste the following commands:
$ mkdir "$HOME"/.dropbox-alt
$ ln -s "$HOME/.Xauthority" "$HOME/.dropbox-alt/"
$ HOME="$HOME/.dropbox-alt"
$ /home/$USER/.dropbox-dist/dropboxd
Dropbox setup wizard window will appear. Finish the setup similarly as described in Method -1
start Dropbox from terminal
$ /home/$USER/.dropbox-dist/dropboxd
start Alternate-Dropbox from terminal
$ HOME="$HOME/.dropbox-alt" && /home/$USER/.dropbox-dist/dropboxd
Note:
You can create a small script with the above commands to start Dropbox.
One can put the script at startup. Don't forget to give the script execution permission.

chmod +x /path/to/script

I have tested the second method. Hope it will be useful.

NOTA: El directori arrel SEMPRE ha de ser "dropbox", l'aplicació (per ara) no permet canviar-ho, és a dir, podem posar la carpeta de Dropbox on vulguem però si el directori final NO és "dropbox", crearà una carpeta dropbox al directori que haguem indicat.

NOTA 2: Per a que funcionés al iniciar KDE, vaig posar l'script als scripts d'inici utilitzant "System settings" / Auto arranque / Archivo de script.

martes, 28 de marzo de 2017

Linux: Instal·lar paquets Debian amb apt encara que un falli (instal·la un per un)

A vegades volem instal·lar una sèrie de paquets però si apt no troba un paquet s'atura. Podem instal·lar-los un per un. Per exemple:

for i in python-all-dev libweather-ion6 libboost-program-options1.55.0 libqt4-network; do sudo apt-get install -y $i; done

Linux: Thunderbird system tray

Si utilitzem l'extensió FireTray, tot va ok però per defecte no permet fet el toggle d'obrir/minimitzar amb un clic de botó esquerre. La sol·lució és (extreta de https://github.com/foudfou/FireTray/issues/147):

  • In Thunderbird:
    'Edit' - 'Preferences' (belonging to Thunderbird) - 'Advanced' (cogwheel symbol)
    - 'General' (Tab) - 'Config Editor' (OK to warning: I'll be careful, I promise)
  • In list search for "extensions.firetray.with_appindicator" and
    double click (changing value from 'true' to 'false')
    [just spotted that this was recommended by foudfou above - that's the real workaround]
  • Restart Thunderbird
  • Thunderbird-Icon - Left Click - 'Preferences' (belonging to FireTray)
  • Enable mail notification - message count type: x unread messages
  • Mail notification type:
    display new message count, Text color: ...your favorite color...
~

Linux: File association


Si fent el que la captura suggereix (apart de la pertinent associació 'tipus d'arxiu/app' que es fa amb el menú contextual) no conseguim que el tipus d'arxiu en qüestió sigui obert per defecte per la app desitjada podria ser que el sistema analitzi les capçaleres de l'arxiu i l'obri segons aquestes capçaleres, ignorant l'app que nosaltres volem. Per evitar que el sistema fagi aquest anàlisi:

Utilitzarem l'exemple dels arxius TPL que jo volia que s'obrissin com a arxius de text i no com a HTML.

1. Obrir l'arxiu /usr/share/mime/packages/freedesktop.org.xml

2. Buscar el tipus d'arxiu que diu que es TPL, Documento HTML i Documento XML

3. Borrar tot el contingut de "magic":

    <magic priority="50">
      <match value="&lt;!DOCTYPE HTML" type="string" offset="0:256"/>
      <match value="&lt;!doctype html" type="string" offset="0:256"/>
      <match value="&lt;HEAD" type="string" offset="0:256"/>
      <match value="&lt;head" type="string" offset="0:256"/>
      <match value="&lt;TITLE" type="string" offset="0:256"/>
      <match value="&lt;title" type="string" offset="0:256"/>
      <match value="&lt;HTML" type="string" offset="0:256"/>
      <match value="&lt;html" type="string" offset="0:256"/>
      <match value="&lt;SCRIPT" type="string" offset="0:256"/>
      <match value="&lt;script" type="string" offset="0:256"/>
      <match value="&lt;BODY" type="string" offset="0"/>
      <match value="&lt;body" type="string" offset="0"/>
      <match value="&lt;!--" type="string" offset="0"/>
      <match value="&lt;h1" type="string" offset="0"/>
      <match value="&lt;H1" type="string" offset="0"/>
      <match value="&lt;!doctype HTML" type="string" offset="0"/>
      <match value="&lt;!DOCTYPE html" type="string" offset="0"/>
    </magic>
   
    i
   
    <magic priority="40">
      <match value="&lt;?xml" type="string" offset="0"/>
      <match value="&lt;!--" type="string" offset="0"/>
    </magic>
   
4. Actualitzar-ho amb: sudo update-mime-database /usr/share/mime

5.  Ara el TPL no hauria de tenir cap associacio si no l'hi hem fet previament i ja podem assignar-li l'associació que vulguem.


Linux: Problemes amb la tarjeta Wifi Intel 7265 (driver iwlwifi)

La tarjeta en qüestió sembla que dona alguns problemes de detecció variable:

02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
De moment, mentre no es milloren els drivers (també hi ha la possibilitat de canviar la tarjeta de xarxa al laptop) editant el següent arxiu sembla que la connectivitat millora:

/etc/modprobe.d/iwlwifi.conf

I afegir la línia: options iwlwifi 11n_disable=8

Jo ho vaig deixar així: 

# /etc/modprobe.d/iwlwifi.conf
# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
# microcode file installed on the system.  When removing iwlwifi, first
# remove the iwl?vm module and then iwlwifi.
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
#options iwlwifi 11n_disable=1
#options iwlwifi wd_disable=0
options iwlwifi 11n_disable=8



Linux: Comparativa caixa externa USB 2.0 i 3.0 amb hdparm

USB 2.0

/dev/sdc:
 Timing cached reads:   25366 MB in  2.00 seconds = 12699.41 MB/sec
 Timing buffered disk reads: 116 MB in  3.01 seconds =  38.60 MB/sec

/dev/sdc:
 Timing cached reads:   27466 MB in  2.00 seconds = 13750.05 MB/sec
 Timing buffered disk reads: 118 MB in  3.05 seconds =  38.71 MB/sec

/dev/sdc:
 Timing cached reads:   26534 MB in  2.00 seconds = 13282.15 MB/sec
 Timing buffered disk reads: 118 MB in  3.04 seconds =  38.82 MB/sec


USB 3.0

 /dev/sdc:
 Timing cached reads:   29370 MB in  2.00 seconds = 14703.78 MB/sec
 Timing buffered disk reads: 448 MB in  3.01 seconds = 148.63 MB/sec

/dev/sdc:
 Timing cached reads:   29162 MB in  2.00 seconds = 14599.85 MB/sec
 Timing buffered disk reads: 448 MB in  3.02 seconds = 148.40 MB/sec

/dev/sdc:
 Timing cached reads:   29672 MB in  2.00 seconds = 14855.88 MB/sec
 Timing buffered disk reads: 448 MB in  3.02 seconds = 148.44 MB/sec



Linux: Directori temporal on Google Chrome emmagatzema els videos (MEGA)

Quan baixem una pel·lícula de MEGA potser la volem veure mentre es descarrega. La podem trobar a la següent ruta: ~/.config/google-chrome/Default/File System/039/p/00

* google-chrome pot variar i ser google-chrome-stable o unstable depenent de la versió.
** els ultims directoris poden variar.