Category Archives: guide/tutorial

Resetting local password of a FortiGate device via FortiManager

Hoping this will save someone from a major outtage just to reset a password. If you have a FortiManager in your environment that manages your FortiGate firewalls/proxies/etc then you’re in luck (I hope).

With the FortiManager in place, it has the ability to run CLI commands against the devices it manages. This is a nice feature because otherwise you would have to reboot the device and perform the password recovery steps, which isn’t fun in a production environment.

For those that are interested as to how this all works, during the initial setup of your HA cluster with the FortiManager, you provide it the device serial numbers. The FortiManager then uses this to log into the child devices (kind of like the bcpbSERIALNUMBER login process during password recovery), the child devices allow this communication because they’re already aware of who the FortiManager is.

  1. Log onto the FortiManager in the environment that you want to do the password reset in
  2. Once logged in, under Device Manager tab, select your ADOM
  3. Go to Scripts
  4. Double click and confirm chng-pwd script is as the following (create new if doesn’t exist)
  5. Right click the chng-pwd script and click Run
  6. Select the device you want to run against
  7. Test the new password!

Broadcom Network Adapters Causing Slow Network Performance

I wanted to give everyone a heads up on a major issue related to Broadcom NICs, these can be found primarily in top shelf HP/Dell servers that are used in production across the globe. The issue is related to poor network performance for virtual machines and this is due to a advance NIC setting which is referred to as “Virtual Machine Queue”.

VMQ is when network traffic is handled by the physical network adapter, it creates a queue of traffic which waits for everything to arrive and then routes it to where it should go. In my experience, this has killed file transfer speeds and what normally would take 30 seconds to complete will now take over 30min!

To disable this evil monster you can do it via Powershell like below:

another way of disabling this is locating your network card properties in Device Manager and going to the Advanced tab, the Virtual Machine Queue property will be in the list.

I originally faced this issue over a year ago and had posted a question over at ServerFault but seemed like no one had a clue on what might be the problem. Hopefully this saves someone the heads, cheers!

HOW TO INSTALL OWNCLOUD ON UBUNTU 14.10 USING HYPER-V PART 3 OF 3

Hello, hello!

We are indeed making some progress, today I will be going over the install process for ownCloud 8.0.2 and walking you through the best practices.

Configure static IP address

Do not leave your machine to grab an IP from DHCP, I suggest you have a spreadsheet that lists all IP addresses within your subnet and there status (free/used/reserved). Doing this has helped me keep my network organized and no more dang IP conflicts!

Using your favorite text editor, open the interface file which is located in /etc/network/interfaces

I have already reserved a IP address in my list so that is won’t get used anywhere else, I suggest you do that same. Under the primary network interface comment is where you want to put your static address.

Once you have entered this information, save your changes (in nano it is CTRL + X) and exit the text editor. At this point it would be a good idea to reboot the machine to insure it does come back up with the correctly set static IP address.

Installing ownCloud 8.0.2

First thing to do is add ownCloud’s repo to apt-get by doing the following command:

If you intend on using apt-get for future updates for ownCloud then I suggest saving the key by doing the following:

Once you have created your repo file and optionally downloaded/saved the key, do the following:

You should see something similar to below…

You will be asked for confirmation, enter Y and let’s get this ball rolling!

NOTE if you did not save the key above then you will get a second prompt warning that the ownCloud packages cannot be authenticated, go ahead and press Y to confirm

During the install process, you will be asked to set a password for the root user for MySQL, I suggest a strong password here and be sure that you keep record of it because we will need it when we configure ownCloud.

Once apt-get is finished downloading all of the bits bring up your favorite

Web browser and go to http://YOURSERVERNAME/owncloud and you will be greeted with the setup page.

At this time, fill in the blanks including the password that you had setup during the install process for mysql and hit Finish Setup.

The setup process will take a few minutes so do not navigate away from the page and let it process. Once the setup finishes you will enter the main dashboard for your user account.

On the top right, click your username and go to the Admin section, from here lets clear up some of the warnings that ownCloud might be complaining about.

 

Resolving the “PHP charset is not set to UTF-8” warning

Let’s jump back into our SSH session and edit the relevant php.ini file that this warning is referring to. Open up /etc/php5/apache2/php.ini in your favorite editor again and search for the phrase “default_charset”. (CTRL + W in nano)

 

Once you find it, remove the colon in front of it to uncomment and after that is done, restart apache2 and refresh the admin page to get rid of the warning.

Here are the commands that I used to achieve this:

Resolving the security warning

You are accessing ownCloud via HTTP. We strongly suggest you configure your server to require using HTTPS instead.

In order to enable HTTPS, we must first enable SSL and assign a certificate to use. To create a self-signed certificate, do the following:

Enable SSL in Apache2

Create Certificate

At this time you will be prompted to enter a bunch of information regarding the certificate, if this is going to be a private server that only you use then feel free to make up and/or leave some fields blank. Here is what I filled out:

Next step is to configure the SSL site for apache2, to do this open the site configuration file and lets edit a few details:

These are the settings that you need to add/change:

Once your certificate is created, restart apache2 and HTTPS/SSL should be working on your ownCloud and you should no longer see the warning in the admin dashboard.

While we are at it, let’s enforce HTTPS by enabling the following options

What these options do is if you go to the HTTP version (plaintext) of your ownCloud, it will automatically redirect you to the HTTPS version.

Recommended ownCloud Apps

Server-side Encryption

To enable this, login as a admin user and go to the Apps section. From there, go to the Not Enabled section.

At this point your ownCloud installation should be fully functional via the web interface or client. What I did on my machines is instead of installing the ownCloud client, I opted to map the drive. To do this in Windows, bring up command prompt as administrator and enter in the following command:

I did something similar on my Macbook Air as well by connecting to the server and mounting the weddav folder associated with my account.

Additional Steps

Port forwarding – If your ownCloud instance is sitting behind a firewall and you need to access it externally, you will need to create a policy on your firewall/router to allow traffic to/from your ownCloud server using TCP 443.

DNS records – I currently use Namecheap as my domain name provider and made a new A record to point owncloud.uglyvpn.com to my external IP address. This process took close to 10hrs to complete but can take up to 48hrs for all DNS changes to propagate around the world.

How to install ownCloud on Ubuntu 14.10 using Hyper-V Part 2 of 3

Welcome back everyone to part 2 in this series of How to Install ownCloud on Ubuntu using Hyper-V, today we will be going through on getting the OS installed and configuring network settings.

Let’s start off by getting our VM started and walk through the initial install steps

Installing Ubuntu 14.10 on Hyper-V

Once you start up the VM it should boot off of the .iso that we attached earlier and ask for your language of choice

Select your preferred language and hit enter key, at the next screen select the top option to “Install Ubuntu Server”

NOTE During this time you may receive an error related to Fast TSC (TimeStamp Counter), this error can be safely ignored. The OS will attempt to retry at a later time on it is own. For more information, visit here

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The next few screens of the installation will ask you about keyboard layout and what your hostname should be, I opted for applinux 

During the install process, you will be asked if you want to encrypt your home directory, this is a personal preference and for my scenario, I opted not to encrypt only the home folder but instead do a entire disk encryption.

NOTE You will be asked for this password when this VM starts up, otherwise it will not boot into the OS. Keep this in mind whenever remotely rebooting as it will not be possible to SSH during that time.

Since this VM will be holding sensitive information outside of the home directory, lets setup partitioning to also encrypt the entire drive. Now why would I want to do this? Well, let’s say someone is able to get onto my Hyper-V host and has the ability to copy/clone/VSS my VM and now they have a version of my Linux App Server….well it won’t be of any use unless they are able to provide the correct key to decrypt!

NOTE Encrypting the disk is entirely optional and may provide performance gains if not used at the cost of security

Be sure that you remember what the encryption key is that you are setting, I would hate for you to lock yourself out of your own server 🙁

Install OpenSSH when you’re given the option, apache2 and mysql will be installed at a later time.

The reason we want to install OpenSSH now is so we can remotely SSH into this server using Putty when the OS finishes installing. From there, we can quickly copy/paste commands into the window because Hyper-V can be finicky when it comes to that. In the meantime, I suggest you go grab your favorite SSH client (mine is Putty) and have it ready for the next portion of this guide.

Once the VM finishes installing and restarts, it will prompt you to login. Once logged in, you should have a similar logon information as below.

Alright folks, this looks like a good spot for me to stop for this iteration in the guide. This should give you a chance to mess around with the install process and allow you to fine tune it to your needs before we start installing ownCloud.

Good luck and see you next time!

See Part 1

How to install ownCloud on Ubuntu 14.10 using Hyper-V Part 1 of 3

The virtualization platform that will be used in this project will be Windows Server 2012r2 Hyper-V and the linux distro that I will be using is Ubuntu Server 14.10.

Here are the steps to getting this virtual machine created

Open up Hyper-V console and create a new Virtual Machine, I named mine AppLinux because I plan to install other applications (plex, subsonic, etc) at a later time.

I opted to use Gen2 because I wanted all of the features, most likely we will not be using most of them but I figure this would be a good learning experience.

I want to give this virtual machine a fixed set of memory to use, based on your servers capacity you could tweak the number around to give better performance. If at all possible, do not use dynamic memory because you do not want to run into a scenario in which this VM will require memory but it is tied up elsewhere!

On the next page, select the virtual switch that you would like to use for this machine. (I left this portion out on purpose because I did not want to introduce any network connectivity issues for my other VMs)

Make sure to store your VHD file in a location where there is enough space, my VHD size is 500gb and set to be a dynamic disk. However, I did notice that even though my disk type was set to dynamic, that during the paritioning phase of the install the VHD grows to its max size even though it shouldn’t. So to reduce any headaches, I know that I can afford 500gb of space on my drives so that’s all I assign it. You can always expand the vhdx at a later time and then resize the partition in the OS.

On the next page locate your Ubuntu 14.10 .iso file and click finish

This is the end of part 1 of this guide, next guide will walk you through the installation process of the OS and then we will start loading up ownCloud and customizing it to our liking.

Dota 2 SteamWebAPI C# .NET

Hello dear friends, since my first post on Reddit I have learned a lot!!! My code for the Dota 2 tool is now on github and I wanted to share some of the progress I have made since I have uploaded it there. The tool now supports these features:

  • GetMatchHistory
    • This provides the latest 100 matches with a lot of the information parsed and reformatted to make sense
  • GetHeroes
    • This method grabs the latest heroes
  • GetMatchDetails [WIP]
    • This method grabs an individual match detail including player information as well as build details

Here is a bit of the output for GetMatchDetails

and here is  a sample output of GetMatchHistory:

As of now, I am only storing this data in memory but once I complete most of the these methods, I will move onto the data store phase. Currently I am leaning towards Microsoft SQL but that might not be the best approach for a long term solution. My end goal would be to keep storing data and allowing our users to use this as a database…similar to DotaBuff but hoping I could keep it free.

Stay tuned for more guides in this series!

You can find the guides here:

If you wish to contribute or see what the code looks like, check out my project on GitHub