Category: computer

  • How to Add a Custom Command to Webmin for your Server

    Server is Mythubuntu 14.04 with Ampache, Apache, WordPress, Postfix and Dovecot email, mythtv, and Owncloud software. This is a post on how to run a script on your server using Webmin. When I first start up my server, I have a LUKS encrypted hard drive (backup) that has to be mounted. I written a script to automate this task. The private key to unlock this disk is stored in my encrypted home folder, so I must login first to open my encrypted home folder and then unlock the backup drive. The script to run is shown below and is called “mount backup disk on startup” and is run from the webmin server.

    custom_commands.main

    The next image shows how to configure the command to run. This command must be run as root.

    custom_commands.edit

    There is very little document on the custom commands for webmin.

  • Text to Voice Synthesizer install in Ubuntu-gnome 15.04

    I have installed software for converting text to speech in Ubuntu-gnome 15.04 linux. I did this to install voice menus for the rockbox firmare/software on my sansa clip+ audio player.

    Installing the software

    sudo apt-get install gespeaker

    sudo apt-get install mbrola

    Install mbrola english-us voices

    sudo apt-get install mbrola-us*

    voices are installed at /usr/share/mbrola

    espeak data folder: /usr/lib/x86_64-linux-gnu/espeak-data

    sudo ln -s /usr/lib/x86_64-linux-gnu/espeak-data /usr/share/espeak-data

    see data folder reference https://bugs.launchpad.net/ubuntu/+source/gespeaker/+bug/919577

    espeak -v mb-en1 “Hello world, process, I am an Aggie”

    mbrola: FATAL ERROR : cannot find file /usr/share/mbrola/voices/en1

    sudo ln -s /usr/share/mbrola /usr/share/mbrola/voices

    espeak -s 140 -v mb-us2 “process, I believe in God the Father almighty, maker of heaven and earth.’”

         or

    espeak -s 140 -v us-mbrola-2 “process, I believe in God the Father almighty, maker of heaven and earth.’”

    espeak -s 140 -v english-us ‘process, I believe in God the Father almighty, maker of heaven and earth.’

    List installed english voices

    espeak –voices=en

    Documentation Location

    /usr/share/doc

    Additional information for improving espeak sound

    http://www.freelists.org/post/nvda/Improving-the-sound-of-eSpeak

     

     

  • Run a Program in the Background with nohup on Ubuntu Gnome 15.04

    This is post is how to run a program from the terminal in the background so that it will continue to run even when the terminal window is closed. I use the nohup command to accomplish this. I have a server that I log into with ssh. I run a rysnc backup command to that copies data to a usb3, 2 GB external hard drive.  This can take several hours to complete. Sometimes I need to close my ssh session, for example to reboot my client computer, yet I don’t want the backup to stop. I am running linux, Ubuntu Gnome 15.04 and all commands are run from the terminal.

    Example of no hup command

    nohup nice -n20 bkup.offsite.cc.com.py > /dev/null 2>&1 &

    I will break down what is happening.

    nohup – prevents the commands following from stopping if the terminal window is closed

    nice -n20 – runs the program bkup.offsite.cc.com.py at a lower priority for cpu resources to prevent other programs on the computer from slowing down

    bkup.offsite.cc.com.py – the python backup program to execute

    > /dev/null 2>&1 – This does not show error messages and output, nohup normally writes standard output to a file nohup.txt. When my output was written to nohup.txt, the file size was 1.2 GB!

    & – puts the command in the background so that you can use the terminal for other tasks

    To see the status of your running application run the following command:

    jobs

    Output will be:

    [1]+  Running   nohup nice -n20 bkup.offsite.cc.com.py &

    A good reference for working with jobs: http://linuxcommand.org/lc3_lts0100.php

    Reference: http://unix.stackexchange.com/questions/32574/when-do-you-need-nohup-if-youre-already-forking-using?lq=1

  • Add Owncloud Clients to Iphone IOS and OSX Yosemite

    Iphone IOS

    Click on this link, http://itunes.apple.com/us/app/owncloud/id543672169?ls=1&mt=8, to open the owncloud client in the App Store. Download and instructions are here https://owncloud.com/products/mobileapps/.

    Mac Laptop or Desktop running OSX Yosemite

    Click on the following link to install the software https://owncloud.com/download#desktop-clients.

    Download and instructions here https://owncloud.com/products/desktop-clients/. “Simply copy a file into the directory and the ownCloud desktop client does the rest. Make a change to the files on one computer, it will flow across the others using these desktop sync clients. Always have your latest files with you wherever you are.”

     

  • How to See Information about a Installed Debian Package

    I needed to see what version of mythtv was installed on my Ubuntu 14.04 server and what dependencies it requires. Here is the solution.

    .deb packages are stored at /var/cache/apt/archives

    View mythtv package name

    #ls -l /var/cache/apt/archives/mythtv*
    mythtv_2%3a0.27.4+fixes.20150514.6b73976-0ubuntu0mythbuntu4_all.deb

    Display Package Version

    # apt-show-versions mythtv
    mythtv:all/trusty 2:0.27.4+fixes.20150514.6b73976-0ubuntu0mythbuntu4 uptodate

    Reference: http://unix.stackexchange.com/questions/6284/check-package-version-using-apt-get-aptitude

    Display Package Information

    #dpkg -I mythtv_2%3a0.27.4+fixes.20150514.6b73976-0ubuntu0mythbuntu4_all.deb

    new debian package, version 2.0.
    size 78060 bytes: control archive=1084 bytes.
    1449 bytes, 34 lines control
    209 bytes, 3 lines md5sums
    Package: mythtv
    Version: 2:0.27.4+fixes.20150514.6b73976-0ubuntu0mythbuntu4
    Architecture: all
    Maintainer: MythTV Ubuntu Maintainers <ubuntu-mythtv@lists.ubuntu.com>
    Installed-Size: 101
    Depends: mysql-server | mysql-server-5.6, mythtv-database, mythtv-frontend, mythtv-backend, ntp | time-daemon | ntp-simple
    Suggests: mythtv-doc
    Section: graphics
    Priority: optional
    Homepage: http://www.mythtv.org
    Description: Personal video recorder application (client and server)
    MythTV implements the following PVR features, and more, with a
    unified graphical interface:
    .
    - Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
    - Video compression using RTjpeg or MPEG-4
    - Program listing retrieval using XMLTV
    - Themable, semi-transparent on-screen display
    - Electronic program guide
    - Scheduled recording of TV programs
    - Resolution of conflicts between scheduled recordings
    - Basic video editing
    .
    http://www.mythtv.org/
    .
    This package will install a complete MythTV client/server environment on a
    single system. If you are intended on using this as your only MythTV machine,
    and this machine is already configured as a desktop, this package will get you
    up and running switfly.
    .
    If you are intended on installing this on a standalone/non-desktop machine,
    you should look into the metapackages available:
    mythtv-backend-master (backend with a local database)
    mythtv-backend (backend needing a remote database)

    Reference: http://askubuntu.com/questions/80655/how-can-i-check-dependency-list-for-a-deb-package

    2015-05-14

  • Fighting Spammers and Hackers From Your WordPress Website

    I have been getting multiple spam attempts on my wordpress blog in the comments section of my blog. These comments have not made it publicly to my blog because I have personally approve each users first comment before they can post a comment. All spam so far seems to come from automated attacks, and the attacks are daily by the same IP address. I have finally decided to do something about this.

    I followed this post, http://www.wpoptimus.com/912/ban-ip-addresses-login-wordpress-dashboard/, and installed the plugins WP-Ban, and Login Security Solution.

    wp-ban

    Anti-spam

    Anti-spam has worked great and requires the least effort. wp-ban works but requires you to manually block ips or domain names. I recommend starting with Anti-spam and only add wp-ban if needed. Anti-spam prevents bots (computer programs) from writing comments on your site. I have never had a real human leave a comment on my site. My site is configured that I have to manually approve the first comment by a person before it becomes visible on my site. Now that I have Anti-spam, my comments page is not filled up with spammers anymore. I like Anti-spam so much that I am giving them a donation.

    Preventing Login Attacks

    I have also added the login-security-solution plugin to block brute force login attacks. Its description is: “Security against brute force attacks by tracking IP, name, password; requiring very strong passwords. Idle timeout. Maintenance mode lockdown.”

  • Roundcube Web Browser Based Email

    I have installed Roundcube email on my server. I now can access my email server with a web browser. If you run your own email server, you should look at Roundcube as another way to access your email. The majority of my email reading uses Evolution, however this allows me to access my email at work or from other people’s computers. I found Roundcube to be easy to install and use. Thanks Roundcube!  http://roundcube.net/

  • Rotating Backups of Mysql database with AutoMySQLBackup version 3.0

    I am now using AutoMySQLBackup version 3.0 to backup my MySQL databases.
    http://sourceforge.net/projects/automysqlbackup/

    I highly recommend this software. It is easy to use and configure. It will create Daily, Weekly and Monthly backups of one or more of your MySQL databases from one or more of your MySQL servers.

    Other Features include:
    – Email notification of backups
    – Backup Compression and Encryption
    – Configurable backup rotation
    – Incremental database backups

  • How to Modify the Dependency of Debian Package in Ubuntu 14.04

    I had added a ppa to run a newer version of mythtv and mysql-server than the current supported software. This led to software update failures due to failed dependencies. I am running mythubuntu 14.04 and this post will show how to change the dependency requirement of a software package so that it will install. This method will use a bash script to save some time. The script uses the nano text editor to change the file. Terminal commands will look like this sentence.

    • Download the script “nano.debcontrol.sh”
    • Change to the directory you want to download the package to
      • cd ~/Downloads/mythtv-27
    • Download the mythtv package to modify
      • sudo apt-get download mythtv
    • List contents of directory to see file name of the downloaded file
      • ls -l
        • mythtv_2%3a0.27.4+fixes.20150423.8f14d3d-0ubuntu0mythbuntu3_all.deb
          -rw-r–r– 1 root root  77K Apr 25 08:09
    • Modify mythtv package
      • nano.debcontrol.sh mythtv_2%3a0.27.4+fixes.20150423.8f14d3d-0ubuntu0mythbuntu3_all.deb
        • Change the following line
          • Depends: mysql-server
          • Change to this
            • Depends: mysql-server | mysql-server-5.6
          • This allows the package to use mysql-server or mysql-server-5.6
        • Save file
          • ctrl + o in nano
    • View new modified mythtv file
      • ls -l
        • mythtv_2%3a0.27.4+fixes.20150423.8f14d3d-0ubuntu0mythbuntu3_all.modfied.deb
    • View package contents and order of files (important)
      • less mythtv_2%3a0.27.4+fixes.20150423.8f14d3d-0ubuntu0mythbuntu3_all.modfied.deb
    • Install modified mythtv file
      • sudo dpkg -i mythtv_2%3a0.27.4+fixes.20150423.8f14d3d-0ubuntu0mythbuntu3_all.modfied.deb
    • Done
  • How to Add Favicon to Worpress Administration Page

    This article contains information on how I added a favicon to my WordPress Adminstration Page. This was for WordPress 4.1.1 hosted on my Ubuntu 14.04 server. I wanted a favicon because I currently have 18 pinned tabs in firefox and I rely on the favicon image to identify the wordpress tab. The general solution is to add a custom function to identify when you are in the administration menu. This function is added to your current theme in the file functions.php. Commands from the terminal will look like this sentence.

    • Change to the theme directory
      • cd /var/www/cc.com/wordpress/wp-content/themes/twentyfifteen-child
    • Edit functions.php
      • nano functions.php

    // The followin code adds a favicon to the wp-admin site
    // from http://clarknikdelpowell.com/blog/how-to-use-favicons-on-the-wordpress-admin-login-pages
    // First, create a function that includes the path to your favicon
    function add_favicon() {
    $favicon_url = get_stylesheet_directory_uri() . ‘/admin-favicon.ico’;
    echo ‘<link rel=”shortcut icon” href=”‘ . $favicon_url . ‘” />’;

    References:

    http://clarknikdelpowell.com/blog/how-to-use-favicons-on-the-wordpress-admin-login-pages

    My article on creating a favicon and a list of references are located at https://blog.chadchenault.com/2015/01/10/create-a-multiple-resolution-favicon-ico-file-with-a-linux-bash-script/.