Updates from Dimitris Kalopsikakis Toggle Comment Threads | Keyboard Shortcuts

  • Dimitris Kalopsikakis 10:10 on 16 November 2016 Permalink | Reply
    Tags: , ,   

    Max without comparison 


    References:

     
  • Dimitris Kalopsikakis 11:45 on 7 November 2016 Permalink | Reply
    Tags: passwordless, rsa,   

    SSH Passwordless Access 

    Suppose you are logged in machine A and you need passwordless access to an account on machine B.

    1) Create RSA keys,

    This will create two files: B_key  which is the private key and B_key.pub  which is the public key of the RSA protocol

    2) Copy B_key.pub  to the file authorized_keys  in the .ssh  directory of the remote account:

    3) In order to login to B paswordlessly:


    References:

     
  • Dimitris Kalopsikakis 11:25 on 7 November 2016 Permalink | Reply
    Tags: , fat32, ntfs, windows   

    Convert a drive from FAT32 to NTFS 

    Suppose you have a flash on drive E: with FAT32 file system and you want to convert it to NTFS:


    Refeences:

     
  • Dimitris Kalopsikakis 06:05 on 25 October 2016 Permalink | Reply
    Tags: , inline, , sed   

    Insert a line in the middle of multiple files 

    Suppose you want to insert a line at 10th line of all files in current directory (e.g. all txt files). The following command creates a backup for each file with the extension “.bak” and changes the files inline.


    References:

     
  • Dimitris Kalopsikakis 22:38 on 28 September 2016 Permalink | Reply
    Tags: encodings, glibc, iconv, iso8859-7, libc,   

    Convert encodings 

    To convert from ISO-8859-7 to UTF-8:

    To list all available encodings supported by iconv:


    References:

     
  • Dimitris Kalopsikakis 17:22 on 28 September 2016 Permalink | Reply
    Tags: avconv, libav, mp3, wav, wma   

    Convert wma to wav, (mp3, etc) 

    To convert wma to wav:

    To convert wav to mp3:

    Installation:


    References:

     

     
  • Dimitris Kalopsikakis 07:00 on 26 September 2016 Permalink | Reply
    Tags: awk, , history   

    Unlimited bash history 

    Short:

    @ /etc/bash.bashrc

    and @ $HOME

    Long:

    Generally speaking, it’s very useful to have the history of all commands you have ever typed. However bash keeps only a limited number of commands.There are two environment variables, HISTSIZE και HISTFILESIZE [read: bash(1) ] which define the maximum number of commands and the maximum number  of lines in the history file. In theory, there is no upper bound to the value you cab assign to them. I real life though, mysterious vanishment of data of the history file has been reported around several times.

    A workaround for this, is defining the envirnment variable PROMPT_COMMAND [read: bash(1)]. A good idea is to define that variable at the central bashrc file of the system, /etc/bash.bashrc , so that unlimited history will be available for all users:

    The first line defines the format of the date. The second line, for each expression that we type, tells bash to print the process id ($$) of current bash session, the username ($USER) and the last line of bash history, which is what we just typed. When we cat the file that our unlimited history is stored, we notice that there are a lot of multiple records of the same command. This happens because when we simply press “enter”, the expression  $(history 1)  has always the value of the last command we typed. We workaround this by creating a little script and use that as a history command:

    In this, awk [read: awk(1)] filters out the duplicated lines.

    Unlimited history is a wise practice for servers.


    References:

     
  • Dimitris Kalopsikakis 22:40 on 25 September 2016 Permalink | Reply
    Tags: , pdfcrop   

    How to crop a pdf 

    e.g.:

    Istallation:  apt-get install texlive-extra-utils 


    References:

     

     
  • Dimitris Kalopsikakis 20:55 on 22 September 2016 Permalink | Reply
    Tags: , , libreoffice,   

    Massively convert odt files to pdf 

    In a bash shell,


    References:

     
  • Dimitris Kalopsikakis 18:05 on 22 September 2016 Permalink | Reply
    Tags: password, , random   

    Random password (python) 

    Creates a password of 10 characters, with letters, digits and punctuation.

     

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel