martes, 1 de diciembre de 2015

Update PDF metadata

From http://askubuntu.com/questions/401114/which-is-the-best-pdf-metadata-viewer-for-ubuntu

  1. View pdf metadata for a file called Example.pdf:
    pdfinfo Example.pdf  
    
  2. Edit existing metadata in the terminal using nano editor:
    pdftk Example.pdf dump_data output Metadata-output.txt
    nano Metadata-output.txt  
    
  3. Update metadata:
    pdftk Example.pdf update_info Metadata-output.txt output Example-new.pdf 
     

martes, 17 de noviembre de 2015

viernes, 4 de septiembre de 2015

To install XCTU (Windows version) on Linux

This is a good tutorial about this.. https://github.com/TauLabs/TauLabs/wiki/Xbee-Programming-on-Linux

However, this is no longer needed because XBee has a Linux version now :D

Anyway, I post this because I think it could help to install other similar windows-based software which needs to connect with usb (serial) ports.

martes, 3 de marzo de 2015

Setting bash as the default shell

Instructions in : http://www.cyberciti.biz/faq/howto-set-bash-as-your-default-shell/

1. Look for the path to bash with

which bash

2. Type:

sudo chsh -s output-path-from-previous-step username

Otherway to do that is to modify the /etc/passwd file.

viernes, 10 de octubre de 2014

Print odd and even lines from a file

sed -n 2~2p filename
will print even-numbered lines from filename
sed -n 1~2p filename
will print odd-numbered lines.

Source: http://unix.stackexchange.com/questions/26723/print-odd-numbered-lines-print-even-numbered-lines

jueves, 9 de octubre de 2014

Create a new user

Type:

useradd username

Set a password:
 
passwd username


To create a new user with directory add -m option

Set up bash as default shell

chsh -s /path/to/shell {user-name}

$ which bash (to kwnow the path to bash)

Source: http://www.cyberciti.biz/faq/howto-set-bash-as-your-default-shell/

lunes, 8 de septiembre de 2014

Delete files from subdirectories


Delete files of a given type:


(example with *.files):


find . -name \*.swp -type f -delete



Delete files by name:

find . -name "file_name.ext" -delete

miércoles, 4 de junio de 2014

Tinyviz codes

export DBG=usr1,usr2

tinyviz -gui -nosf -noconsole -run "/opt/tinyos-1.x/apps/cdShortestPath__copie20-sep/build/pc/main.exe -rf=/opt/tinyos-1.x/apps/topology.nss -b=0" 40

miércoles, 10 de abril de 2013

Typical problems with printers and scanners

  • "The system printing service doesn't seem to be available" message.

    If you see this message make sure that you have cups installed and that it is properly running..
  • "No scanners detected".
    Sometimes you can have some problems to detect scanners from software such as xsane. If so, try to execute xsane as sudo. If you can detect your scanner as super user, the it is probably that you have no permissions as a simple user. To fix it, use lsusb to determine the device of your scanner, navigate to /dev/bus/usb/$BUS/$DEVICE and check the permissions of that device, i.e. what group it belongs to. Try to give your user the necessary groups for it, or if that fails, chmod the device (as suggested in the thread). (from: http://superuser.com/questions/104184/xsane-is-unable-to-detect-scanner-device).
  •  Related commands: lsusb, sane-find-scanner, scanimage -L

martes, 9 de abril de 2013

Notes for network configuration

  • (Examples with eth0)
  • Examples of network configuration files.
    • In /etc/network/interfaces
      • With DHCP
                               #The primary network interface
                               allow-hotplug eth0
                               iface eth0 inet dhcp
      • With static IP
                               iface eth0 inet static
                               address <IP ADDRESS>
                               netmask <SUBNET MASK>
                               network <NETWORK ADDRESS>
                               broadcast <BROADCAST ADDRESS>
                               gateway <GATEWAY ADDRESS>
  • DNS servers. In /etc/resolv.conf
  • Adding default address to local route table. Enter: sudo route add default gw <GATEWAY ADDRESS>
  • Restart eth0
    • ifdown eth0
    • ifup eth0