Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, 7 November 2015

Create a bootable USB from an ISO using dd on the Linux command line

Install syslinux, a suite of utilities which ensures the iso image is in SYSLINUX format rather than ISOLINUX

    $ sudo apt-get install syslinux

Convert the iso image to SYSLINUX format

    $ isohybrid /path/image.iso 

Locate the USB device 

    $ lsblk
    sdb         8:16   1   3.8G  0 disk 
    └─sdb1      8:17   1   3.8G  0 part /media/user/usb_disk

Unmount the USB device

    $ sudo umount /dev/sdb1

Ensure it is indeed unmounted

    $ lsblk
    sdb         8:16   1   3.8G  0 disk 
    └─sdb1      8:17   1   3.8G  0 part 

Copy the ISO image onto the USB deisk

    $ sudo dd if=/path/image.iso of=/dev/sdb1

Tuesday, 6 October 2015

Gnome - change default application for text files

xdg-mime query default text/plain
xdg-mime default sublime_text.desktop text/plain

xdg-mime query filetype application/x-shellscript
xdg-mime query default application/x-shellscript

Wednesday, 19 August 2015

Send email from script

Install ssmtp:

    $ sudo apt-get install ssmtp

Edit the ssmtp config file:

    $ sudo vim /etc/ssmtp/ssmtp.conf

Enter this in the file:

root=username@gmail.com
mailhub=smtp.gmail.com:465
rewriteDomain=gmail.com
AuthUser=username
AuthPass=password (create a app-specific password in google accounts)
FromLineOverride=YES
UseTLS=YES

Enter the email address of the person who will receive your email:

    $ ssmtp recepient_name@gmail.com

Now enter this:

To: recipient_name@gmail.com
From: username@gmail.com
Subject: Sent from a terminal!

Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
(Notice the blank space between the subject and the body.)

To send the email: Ctrl + D

You can also save the text mentioned in Point 5 into a text file and send it using:

    $ ssmtp recipient_name@gmail.com < filename.txt

http://askubuntu.com/questions/12917/how-to-send-mail-from-the-command-line

Tuesday, 2 June 2015

CheckInstall

CheckInstall keeps track of all the files created when installing from source ($ make install), builds a standard binary package and installs it using the system package management software (apt / yum etc), allowing you to later uninstall it

 tar -zxvf source-app.tar.gz;
 cd source/ ;
 ./configure;
 make;
 sudo checkinstall make install;

https://wiki.debian.org/CheckInstall

Thursday, 9 April 2015

Ubuntu terminal tab colors

This sets dark tab colors, except for the active tab, which is higlighted

$ vim ~/.config/gtk-3.0/gtk.css

TerminalWindow .notebook {
    background-color: shade (#333333, 1.02);
    background-image: none;
    border-radius: 3px;
    padding: 2px;
    background-clip: border-box;
    border-color: shade (#333333, 0.82);
    border-width: 1px;
    border-style: solid;
    /*box-shadow: inset 0 1px shade (#AEA79F, 1.1);*/
    /*font-weight: 300;*/

}

TerminalWindow .notebook tab {
    background-image: none;
    background-color: #333333;
    border-style: solid;
    border-image: -gtk-gradient (linear, left top, left bottom,
                                 from (alpha (shade (#333333, 0.9), 0.0)),
                                 to (shade (#333333, 0.9))) 1;
    border-image-width: 0 1px;
    border-color: transparent;
    border-width: 0;
    box-shadow: none;
    /*color: shade (@fg_color, 1.2);*/
    color: #AEA79F;
}

TerminalWindow .notebook tab:active {
    border-color: shade (#333333, 0.82);
    border-style: solid;
    border-width: 1px;
    background-color: shade (#AEA79F, 1.02);
    background-image: none;
    /*box-shadow: inset 0 1px shade (#AEA79F, 1.1);*/

    color: #333333;
}