Posts tagged ‘Linux’

Post

Using Let’s Encrypt and Interworx

So I thought I was a hotshot borrowing a script from another blog for another issue with our Interworx cluster.  Now, we’re unique for the company that I consult for, they use:

  • Interworx with multiple nodes
  • AWS
  • Cloudflare
  • Load balancers not part of Interworx

It’s quite the slick setup… Cloudflare perks, load balancing, and great performance from the Interworx product.  That said, to just manage the website, we wanted to use Let’s Encrypt for SSL use to manage the nodes.   Below is a script I modified from this blog to serve the purpose and is free for you looking to do the same!

#!/bin/bash

user=[email protected]

key=$(cat /etc/letsencrypt/live/interworxnode.yourdomain.com/privkey.pem)
sslcrt=$(cat /etc/letsencrypt/live/interworxnode.yourdomain.com/fullchain.pem)

cypher=HIGH:MEDIUM:!EXPORT:!SSLv2:!SSLv3:!TLSv1:!ADH:!aNULL:!eN ULL:!NULL:!LOW

nodeworx -u $user -o pretty -n -v -c Ssl –ssl_ciphersuite $cypher –key $key –crt $sslcrt –restart_now 1 –services SSL_Apache,SSL_IWorxWeb –action updateall

So, a few things here:

  • You need to create a siteworx account just for the domain itself, in my example, interworxnode.yourdomain.com should be created just for the sole purpose of generating Let’s Encrypt certs using the standard method in the Interworx SSL config panel.  So create the SSL certs first using Interworx for your domain you just created so it is there before running the script above.
  • Interworx will take care of renewing the certificate through it’s own jobs that are active, so you don’t need to do anything with renewals for Let’s Encrypt.
  • This script can be a cronjob to run quarterly during the year, then you will ensure you get a new cert updated into the admin portal.  I run mine in July, October, January, and April, for example.  The goal of this script is to just “steal” the SSL certs from the interworx site and reapply them to your admin portal.
Post

Fedora and Vivaldi with Flash and ffmpeg support

So if you haven’t tried it yet, I strongly suggest giving Vivaldi a try.  It combines the base code of Chromium without the Chrome features you may not want with an interesting user interface.  To me, this is the best setup:

  • Chrome/Chromium underpinnings, so you don’t have website compatibility issues (Think Opera, a good browser, but odd support for online banking and other strict websites.  Yes, I know you can spoof the user agent, but the fact you have to do that doesn’t help non-power users, IMO.)
  • The user interface is fun, some of my favorites:
    • Mouse Gestures
    • Adaptive user interface
    • Notes

For Fedora users, the Vivald RPM from their website does install easy enough, but you can’t play Vines, Twitter Video, etc. because you don’t have functional ffmpeg support nor Flash if you use SiriusXM or other Flash only websites.  So, here’s a quick fix for you:

The Long Way

For Vine/Twitter Video support, the Vivaldi RPM comes with a libffmpeg.so located in /opt/vivaldi/lib , but it doesn’t run have support for h264/mp4 due to licensing restrictions.  What I did next was fire up a VM with Linux Mint and built chromium-codecs-ffmpeg-extra .  From there, I took libffmpeg.so and copied it to my Fedora install at /opt/vivaldi/lib after backing up the stock libffmpeg.so .  Double check that your standard user can read the plugin by:

# chmod 644 libfmpeg.so

For Flash Player, I had Chrome installed on the Linux Mint VM, so I just copied the directory /opt/google/chrome/PepperFlash to my Fedora machine and:

# chmod -R 644 /opt/google/chrome/PepperFlash

Then I restarted Vivaldi and had up-to-date Flash and working H.264/MP4 support.  Because I had the VM, it literally took me minutes to build, copy, and run these updates. Still, I’d love a repo from RPMFusion or someone that is really trustworthy, but that won’t happen with h.264/MP4 it appears.

The Easy Way

You are welcomed to use my plugin I built for libffmpeg.so and Flash, I realize not everyone is as paranoid as I am or just want to run it for testing purposes in a VM, etc.  I do not believe I’m violating any distribution rights from Adobe for the Flash Player since it is the Pepper plugin as opposed to Linux 11.2 version.  I’m sure Adobe will let me know otherwise…  Save libffmpeg.so to /opt/vivaldi/lib and libpepflashplayer.so to /opt/google/chrome/PepperFlash, enjoy!

libffmpeg.so   built on August 12th 2016
SHA1: d6514e2c0a16318d1feaf162ff6e6e035e36972c

libpepflashplayer.so     version 22.0.0.209
SHA1: 727799f1aba7a98052ec855a81c2b797c6f0025b

Post

VMWare Workstation for Linux and Windows guests have poor sound

So I run Fedora 23 at home and one of my VMs was running Windows 10, but the sound was awful.  The sound would have a horrible echo and “scratchy” sound, sometimes after it would play for a bit, it would “fix itself”.  I tried the following:

  • Different drivers in the .vmx file including sb16 (didn’t work at all)
  • Tried Windows 7 to see if it was a Windows 10 issue (nope the issue happened with any version of Windows)
  • Issue didn’t happen with virtual Linux guests
  • Fresh Windows 7, then 10 install (still had the issue by default
  • Tried the fix from VMWare for audio with the speaker output (didn’t fix it, in fact, 24bit made it worse)

Long story short, I finally found this thread that worked for me.  It just installed a legacy adapter in Windows 10 and it worked perfect!!  As long as I was in the .vmx, I installed the VMXNET3 driver by changing the network adapter from “E1000” to “vmxnet3” for better performance!

 

Post

Watchguard SSL-VPN for Linux

Borrowing a lot from this site, I wanted to update the process on using Mobile VPN with SSL Watchguard. Here’s what you need to do:

  1. Do not download from the sslvpn.html page of your VPN appliance, it won’t have all the steps for the Linux side of the house.
  2. Do download the CRT, PEM, and CA files from your Windows or Mac SSLVPN client installation.  For Windows, it is found in “%Appdata%\Watchguard\Mobile VPN” and grab the following to copy over to your Linux installation:
    1. ca.crt
    2. client.crt
    3. client.pem
  3. If you are using SELinux, you must copy the files from step 2 into ~/.cert or SELinux will whine and stop your connection as the certificates can’t lay around your home folder without intervention not covered here.
  4. Setup an openvpn client using the following settings:
    1. gateway = your pick
    2. Connection type = X.509 with password
    3. CA file = ca.crt
    4. Certificate = client.crt
    5. key = client.pem
    6. Key password = <unneeded>
    7. Username and password is your setup
  5. While setting up the connection, you need to tweak the settings by clicking on “Advanced” which is in the screen from step 3
    1. Gateway port = 443
    2. Tunnel and UDP fragment size = Automatic
    3. Check “Use custom reneotiation interval” = 36060 (default from Watchguard)
    4. Check “Use TCP Connection” as this is a SSLVPN on TCP 443
    5. On the Security tab, your cipher should be AES-256-CBC and the HMAC Authentication should be SHA-1

That’s it, the connection will fire right up and run without further settings.  Enjoy!

Post

How to clone a Linux Physical server or workstation to Hyper-V

So at one particular company, they use Hyper-V (on 2012 R1) to drive their virtualization platform. I used to have problems with Hyper-V since it had poor Linux and BSD support, but that is coming along now.  Major Linux distros are embraced by Microsoft and the Linux Kernel has support, but the tools to convert are lagging.  A little Googling will find that there are some guides using outdated tools that aren’t made by Microsoft. So here is an easier way to do that and save your day:

1. Download Clonezilla and copy the Physical Linux  computer to an img file on an external drive of some sort.  No special options are required if you do disk to image.

2. Create a DYNAMIC partition on Hyper-V that is big enough to absorb the source partition.  If the machine was a 500GB machine, make a 550GB partition and thin provision it.

3. Restore the image file by booting up Clonezilla from the guest host you build in Hyper-V.

4. When done, download GParted and shrink the partition down to whatever size you want.  If you were only using 200GB from my example above, you can shrink down to 300GB if you would like.

5. With the guest machine off, make sure your drive in Hyper-V is a vhdx format, not vhd.  If it is vhd, convert it to vhdx and then, only then, can you shrink the virtual disk down to your Gparted size.

6. As of this posting, Linux and Hyper-V can’t get along with dynamic MAC addresses for nic adapters, set a static MAC to your NICs in your guest linux machine, be ready to setup your nics again on the distro of your choice.  Also, do not use Time-Sync from the hyper-v vitualization tools, as of this posting, it isn’t the most stable and I use ntpupdate rather than tweaking config files, time.nist.gov is a great NTP server to use.

That’s really it, I’m running Kali Linux and CentOS on a Hyper-V advanced cluster