Author: Dave Lasley

  • Install scipy for python 2.7 in Ubuntu

    Surprisingly the `scipy` package was not as straightforward of an installation as most Python modules; this tutorial will walk you through that process. # The first step is to download `easy_install`, and the libraries required for `scipy` {{{ lang=bash sudo apt-get install python-setuptools liblapack-dev libblas-dev }}} # Use `easy_install` to install `scipy` and other required…

  • Flush DNS Cache in OSX, Linux, and Windows

    =Windows (Prior To Vista)= # Click `Start`->`Run`, type `cmd`, then hit the `Enter` key # In command prompt, type `ipconfig /flushdns`, then hit the `Enter` key =Windows (Vista and Later)= # Click the `Start Orb` # Type `cmd`, then hit the `Enter` key # In command prompt, type `ipconfig /flushdns`, then hit the `Enter` key…

  • Dynamic DNS with Ubiquiti EdgeRouter (Vyatta)

    This tutorial will walk you through the process of setting up Dynamic DNS on an EdgeRouter. In my network topology, the WAN is connected to `eth2`; change that to whatever interface you would like. Create an account with a supported service provider. If you do not want to use one of the below providers, I…

  • Add EPEL Repository to CentOS

    The [[http://fedoraproject.org/wiki/EPEL|EPEL]] repository contains quite a few useful packages for CentOS. Below are the steps to add this repository to your system: {{{ wget http://mirror.pnl.gov/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -i epel-release-6-8.noarch.rpm rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 }}}

  • Download YouTube Videos using KeepVid

    This tutorial is designed to walk through the steps of downloading a YouTube video as an mp4, flv, 3gp, webm, or mp3 file. **Note that [[http://www.youtube.com/static?gl=US&template=terms|Youtube’s TOS]] prohibits the downloading of content (as of 5-22-2013):** >Content is provided to you AS IS. You may access Content for your information and personal use solely as intended…

  • Install/Configure PPTP Client (RHEL/CentOS/Ubuntu)

    Install PPTP Client Ubuntu/Debian {{{ sudo apt-get install pptp-linux }}} RHEL/CentOS/Fedora {{{ sudo yum install pptp }}} Modify chap-secrets `/etc/ppp/chap-secrets` and add the below line (replacing variables) {{{ $USERNAME PPTP $PASSWORD * }}} Create a config file named `vpn.domain.com` in the directory `/etc/ppp/peers`, and add (replacing variables) {{{ pty “pptp $VPN_SERVER –nolaunchpppd” name $USERNAME remotename…

  • Change WebUI Port – Ubiquiti EdgeRouter Lite

    The below tutorial will walk you through altering the Web UI port on a Ubiquiti Edge Router Lite. # Log into router via ssh/console # Enter configure mode {{{ lang=bash configure }}} # Set the Web UI port; change `8443` to whatever you would like {{{ lang=bash set service gui https-port 8443 }}} # Commit…

  • Set up Subversion with SSH (svn+ssh)

    [[[TOC]]] =Setup SVN Server= Install Subversion Red Hat/CentOS/Fedora {{{ lang=bash sudo yum install subversion }}} Debian Based (Ubuntu) {{{ lang=bash sudo apt-get install subversion }}} Create a repository {{{ lang=bash sudo mkdir /data01/svn sudo mkdir /data01/svn/repos sudo svnadmin create /data01/svn/repos/new_repo }}} Create an SVN group (add whichever users you would like to it) {{{ lang=bash…

  • Setup & Use Pymongo

    Install mongodb [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/|Red Hat Enterprise, CentOS, or Fedora Linux]] [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/|Ubuntu]] [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/|Debian]] [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/|Generic Linux]] [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/|OS X]] [[http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/|Windows]] Install pymongo {{{ lang=sh sudo easy_install pymongo }}} Connect with MongoClient {{{ lang=python import pymongo client = pymongo.MongoClient(‘localhost’, 27017) }}} Get a Database {{{ lang=python db = client.test_db # OR db = client[‘test-db’] }}} Get a Collection {{{ lang=python…

  • Unix Epoch Programming Reference

    Below is a table indicating how to obtain a Unix Epoch Timestamp from various programming languages: |=Language|=Command| |Actionscript| (new Date()).time | |ASP| DateDiff(“s”, “01/01/1970 00:00:00”, Now()) | |C++| #include std::time(0); | |C#| epoch = (DateTime.Now.ToUniversalTime().Ticks – 621355968000000000) / 10000000; | |Erlang| calendar:datetime_to_gregorian_seconds( calendar:now_to_universal_time( now()) )-719528*24*3600 | |Java| long epoch = System.currentTimeMillis()/1000; | |JavaScript| Math.round(new Date().getTime()/1000.0) getTime()…