The Archives

  • 04.Feb.15
    Editing Binary Files shell | rafacas | (0)
    In a previous post we learnt how to back up the MBR of a hard disk in a file called mbr.img. That file has the first 512 bytes (the first sector) of the hard disk. One way to see the content of a binary file is dumping it to hexadecimal. In Linux the xxd command makes a hex dump: $ xxd mbr.img 0000000: eb63 9010 8ed0 bc00 b0b8 0000 8ed8 8ec0 .c.............. 0000010: fbbe 007c bf00 06b9 0002 f3a4 ea21 0600 ...|.........!.. 0000020: 00be be07 3804 750b 83c6 1081 fefe 0775 ....8.u........u 0000030: f3eb 16b4 02b0 01bb 007c b280 8a74 018b .........|...t.. 0000040: 4c02 ...
  • 18.Feb.11
    Moving between encodings with emacs automated, scripts, shell | pfortuny | (0)
    I live in Spain. I work at Academia. This is a problem. My School's computers are plagued with Windows (XP!), my pupils most certainly use Windows (I bet it is 7) and I use (obviously) an MBPro with Snow Leopard. Even more, my School's servers are Linux. This gives rise to latin-1, UTF-8 collisions. While writing some text-only documents for use with MATLAB (another problem, by the way) I realized I was going to need to convert them from my Mac's UTF-8 to Windows latin-1 every time I edited them. Time for a makefile. I am not commenting this though, only the ...
  • 27.Apr.10
    Setting variables in emacs at file header shell | pfortuny | (2)
    When editing LaTeX files, I usually call the master file of a project 00father.ltx for historical reasons. Moreover, the following line is part of my .emacs: (setq-default TeX-master "00father.ltx") because most of the time I am editing multifile projects. However, from time to time I need to write a single-file document and in this case, naming it 00father.ltx is not that useful, and I do not want to have to set the master-file variable each time I load the file. There is an easy way to get this done. Just include a line at the top of the file -as a comment in the ...