Millors fonts

Llibreries infinality per aconseguir un millor renderitzar de les tipografies.

https://launchpad.net/~no1wantdthisname/+archive/ppa

Install:
   $ sudo add-apt-repository ppa:no1wantdthisname/ppa
   $ sudo apt-get update
   $ sudo apt-get upgrade
   $ sudo apt-get install fontconfig-infinality

Set and test MTU

sudo ifconfig eth0 mtu 9000 // test diferent values

ping -M do -s 9000 192.168.x.x // mtu lowes on both connections

Check local open ports

netstat -tap

ssh-copy-id Mac

curl https://raw.github.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id
chmod +x /usr/local/bin/ssh-copy-id

M'ha calgut comentar aquetes linies per fer-lo funcionar

#else
#  if [ x$SSH_AUTH_SOCK != x ] ; then
#    GET_ID="$GET_ID ssh-add -L"
#  fi

Aturar / tancar sessió usuaris

Aturar / tancar sessió usuaris:

#Aturar
skill -STOP -u usuari 

#Continuar
skill -CONT -u usuari

#Treure fora
skill -KILL -u usuari

Error al iniciar els nous usb d'ubuntu

ubuntu error: no configuration found no default or UI configuration directive found

isolinux -> syslinux (carpeta)
isolinux.bin -> syslinux.bin
isolinux.cfg -> syslinux.cfg

Auto desconectar els usuaris inactius de bash

​Useu la variable del terminal TMOUT = nombre de segons

TMOUT=300

Es pot afegit globalment a /etc/bash.bashrc

 

Web Dav

 

Carregar els mòduls d'apache

dav i dav_fs

Afegir a la definitició de directori 

Dav On

Caldria també afegir algun mòdul de seguretat.

bash - inline data

cat <<CONSULTA
select *
from taule
where camp=elvalor
;
CONSULTA

Comprovar si una IP està activa en bash. bash inline if

ping -c 1 192.168.1.1 > /dev/null && echo "ON" || echo "OFF"

Temps per posar a domir un disc

 sudo hdparm -S100 /dev/sdb

Variant la S segons el disk.

Suspendre l'ordinador i que s'engegui a una hora

sudo rtcwake -m disk -s 60

o posar l'hora de recuperació:

sudo rtcwake -m no -l -t $(date +%s -d ‘tomorrow 01:00’)

ssh-copy-id en un port diferent a 22

ssh-copy-id "usuari@port -p 2222"

Faenza icon theme

sudo add-apt-repository ppa:tiheum/equinox
sudo apt-get update
sudo apt-get install gtk2-engines-equinox equinox-theme faenza-icon-theme

Evitar que l'ubuntu demani per enviar notificacions d'errors

sudo apt-get remove sudo apt-get remove apport-gtk apport
 

Drupal Clean-URLS

Per evitar en drupal el cassic error:

 

Not Found

The requested URL /admin/content was not found on this server.

site /?q=admin/config/search/clean-urls - per provar

.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

google apps jabber service

Configurar els servidors de missatgeria jabber talk en dominis sota google apps

_xmpp-server._tcp.enging.com. IN SRV 5 0 5269 xmpp-server.l.google.com.
_xmpp-server._tcp.enging.com. IN SRV 20 0 5269 xmpp-server1.l.google.com.
_xmpp-server._tcp.enging.com. IN SRV 20 0 5269 xmpp-server2.l.google.com.
_xmpp-server._tcp.enging.com. IN SRV 20 0 5269 xmpp-server3.l.google.com.
_xmpp-server._tcp.enging.com. IN SRV 20 0 5269 xmpp-server4.l.google.com.
Let's break down the first line for you:
_xmpp-server._tcp.enging.com. IN SRV 5 0 5269 xmpp-server.l.google.com.
Here's what it means when you're filling up a form:
Name: enging.com.
Service: _xmpp-server
Protocol: _tcp
Hostname (combination of above): _xmpp-server._tcp.enging.com.
Priority: 5
Weight:  0
Target: xmpp-server.l.google.com.

Cercar arxius modificats fa X dies

find . -maxdepth 1 -mtime -1 -ls

El simbol -1 indica dies. Si fos 1 serien minuts

Muntar una partició d'una imatge de disc dur

 

$ parted pimame-0.4.img unit b print
WARNING: You are not superuser.  Watch out for permissions.
Model:  (file)
Disk /home/carles/Baixades/pimame-0.4.img: 2014838784B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
 
Number  Start      End          Size         Type     File system  Flags
 1      4194304B   62914559B    58720256B    primary  fat16        lba
 2      62914560B  1939865599B  1876951040B  primary  ext4
 
----------------------------------------------------------------------------------------------
 
sudo mount -o loop,offset=62914560 pimame-0.4.img folder

 

 

Saber la longitud en bits de la paraula del processador (i sistema instaŀlat)

getconf LONG_BIT

A diferència del uname que ens torna la estructura (i386, x86_64...)

Altres comandes relacionades

lscpu, uname -a, dpkg-architecture

Auto despertar l'ordinador a una hora determinada

 

#!/bin/sh
# Super cheesy script to wake my computer every day
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo `date '+%s' -d '+ 480 minutes'` > /sys/class/rtc/rtc0/wakealarm
cat /sys/class/rtc/rtc0/wakealarm > /var/log/last_known_wakeup_time

Aturar l'xbmc en raspbmc

sudo initctl stop xbmc

 

channels conf de Barcelona

Llista de canals a Barcelona (Horta) obtinguda amb:

 w_scan -c ES -C UTF-8 -M > ~/.mplayer/channels.conf

attachment: 
AttachmentSize
channels.conf_.xz1.79 KB

Per instaŀlar adobe air en un ubuntu 12.10 (o 12.04)

A l'executar adeboeair.bin dona un error que li cal gnome-keyring.

Per evitar-ho farem:

sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0

Pages

Subscribe to Bitacoles RSS
Error | Bitacoles

Error

The website encountered an unexpected error. Please try again later.

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/bitacoles/includes/common.inc:2726) in drupal_send_headers() (line 1233 of /var/www/bitacoles/includes/bootstrap.inc).
  • PDOException: SQLSTATE[HY000]: General error: 14 unable to open database file: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); Array ( [0] => 0 [1] => cron [2] => Attempting to re-run cron while it is already running. [3] => a:0:{} [4] => 4 [5] => [6] => http://bitacoles.enging.com/node?page=1 [7] => [8] => 54.162.60.75 [9] => 1500914854 ) in dblog_watchdog() (line 160 of /var/www/bitacoles/modules/dblog/dblog.module).