Apr 03 2016

Configure OS X Network Hostname

Category: #apple,#howto,#networking,#osx —  Juan @ 10:56 

The power of OS X allows users to set their computer hostname from command line. This can be useful should you need to set hostname remotely. So, fire up a terminal window, enter root user mode, and follow the next few steps.

Change the FQDN hostname of your Mac (ex: computer.domain.net):

$ scutil --set HostName <new_host_name>

kontinue reading…

Tags: , , , ,

Mar 06 2016

Plex Media Server Ubuntu Linux Configuration

Category: #generik,#howto,#linux,#ubuntu-server —  Juan @ 12:26 

This HOWTO is exclusively for users who manually install Plex Media Server on Ubuntu Server Edition using Plex’s debian package rather than relying on Ubuntu to provide timely updates.

When running Plex Media Server on Linux distributions, it is possible to change the user Plex Media Server runs as and where it stores metadata. To change the startup configuration and context of the systemd service, edit the systemd service file:


To change location where Plex Media Server stores metadata files, change the Environment setting for PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR in the plexmediaserver.service file.

You can edit the path within the quotation marks to any directory of your choice. The path and directory you define must exist and must be owned by the Plex Media Server.

The default user that Plex Media Server runs as is plex. To change the user context under which Plex Media Server runs as, change the variables User and Group in the systemd service file. When you change the user and group, remember to change the ownership of your Plex Media Server’s Application Support Dir.

For changing from user plex to some_other_user then remember to run:

$ chown -R some_other_user /var/lib/plexmediaserver

After making any configuration changes, it is important to refresh the systemd subsystem. To refresh the systemd subsystem, run the following command for changes take effect on the next restart/boot.

$ systemctl --system daemon-reload

Next, restart the Plex Media Server service:

$ service plexmediserver restart


You can start, stop, restart Plex Media Server as such:

$ service plexmediserver (start|stop|restart)

For reference, here is the default systemd service file:

Description=Plex Media Server for Linux

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'


This document is based on this article.

Tags: , , ,

Dec 09 2015

HOWTO Disable System Integrity Protection on El Capitan

Category: #apple,#generik,#howto,#osx —  Juan @ 10:13 

Restart your Mac and press the ‘Command + R’ key combinations as soon as you hear the startup chime. This will boot your Mac into Recovery Mode. Once in Recovery Mode, in the Menu bar, click on:


Utilities -> Terminal

Type in the following command to disable rootless mode:

$ csrutil disable

Restart your Mac for changes to take effect. To check rootless mode, launch Terminal, and type in the following command:

$ csrutil status

Either you’ll get an ‘enabled’ or ‘disabled’ message.


May 30 2013

HOWTO Remove Power Notification from Sense 5.0

Category: #android,#howto,#yourewelcome —  Juan @ 09:59 

This hack simply disables the Power Saver Notification that appears on HTC Jellybean Sense 5.0 devices.

$ adb shell
$ su
$ pm disable com.htc.htcpowermanager/.powersaver.PowerSaverNotificationReceiver

Reboot device when finished. Power Saver Notification should not be disabled in your drawer without disabling Power Saver completely.

The simpler solution would be to download Jmz Power Saver Disabler.

Tags: , , , , ,

Apr 12 2013

Howto Reset PHP Static Variable

Category: #apache,#howto,#linux,#networking,#root,#ubuntu-server —  Juan @ 13:21 

Today, I spent about an hour trying to figure out how to clear [or reset] a PHP static variable. PHP static variables do not do what you may initially think. PHP static variables do not carry over from page to page as $_SESSION does.

In any case, take the following function as example:

function get_config_option($option)
   static $local;
   global $db;

   if ((count($local) == 0) || !is_array($local))
      $local   = array();
      $sql  = "SELECT option_name, option_value FROM some_table";
      $result  = $db->sql_query($sql);

      while ($row = $db->sql_fetchrow($result))
         $local[$row['ab_option_name']] = trim(stripslashes($row['ab_option_value']));

   return $local[$option];
kontinue reading…

Tags: , , ,

Sep 27 2012

HOWTO Configure And Deploy ISC DHCP Server

Category: #howto,#internet,#linux,#networking,#ubuntu-server —  Juan @ 08:57 

This guide explains how to configure the ISC-DHCP-Server by Internet Systems Consortium. ISC is the same development group that develops Bind9, so we can rest assured that we are configuring and deploying a trusted, quality DHCP server.

This guide assumes you have a fully functional Ubuntu server running 10.4 or newer, which is the scope of this guide. This guide can be applied lightly to other Linux distributions, presumably at different locations.

Because ISC DHCP is developed by the group that develops Bind9, we follow the same configuration outline as for Bind9, packaged for Debian/Ubuntu. The root configuration directory will be the main configuration directory that ISC-DHCP expects which may or may not contain several files but we only care about one, as we distribute configuration over several files.

Now, let’s get started… kontinue reading…

Tags: , ,

Sep 26 2012

HOWTO Log Remote Devices With RSyslog

Category: #howto,#linux,#networking —  Juan @ 09:49 

System logs are an important part of an administrator’s job because logs, on paper, capture most of what’s going on on any given server, at any given time. Sometimes, we need to monitor remote devices that don’t have a means of logging to the device itself. When this is the case, any server running rsyslog can log remote devices, easily.

In just 5 minutes, you can be logging all of your remote devices to a single, central log server over UDP. UDP is the chosen protocol because it’s faster than TCP (although it does lack error checking).

Let’s get started. kontinue reading…

Tags: , , , , ,

Sep 06 2012

HOWTO Update DynDNS Hosts Nightly With Cron

Category: #howto,#kode,#linux,#networking —  Juan @ 09:10 

Many of us have super fast broadband at home. Unfortunately, with the super fast broadband most of us have, we only get a dynamic IP address. This isn’t nesessarily a bad thing as fortunately, there are services out there that give you domain URLs to use with your dynamic IP. How is this possible you ask? Well, for instance, there’s Dyn that specialized in DNS services. They provide users with domains along with an easy API to update the IP address of the domains you choose.

You can sign up for a free account at Dyn and they give you two free host names with their free service. If you pay $20/yr, you get 30 hostnames and they never expire within your yearly subscription.

Great, so now you have these host names and now you want to know how to easily update those hosts when your dynamic IP address has changed. Well, you’re in the right place. I have two scripts for you to make your life easier. All you need is linux servers: one running cron and the other running a web server, such as lighthttpd or Apache, as your own hosted dedicated server or server in a lease out data cage. In short, Dyn needs to know your IP address and we need to get that IP address from a reliable source; you. If you don’t meet these requirements, then this guide is probably completely useless to you.

kontinue reading…

Tags: , , ,

Sep 05 2012

HOWTO Use the Date Command with Bash

Category: #generik,#howto,#kode,#linux,#osx,#ubuntu-server —  Juan @ 09:41 

The date command is full of surprises. At first, it may seem confusing but once you get the hang of it, it becomes second nature.

Syntax to specify format => date +”FORMAT”

Type the following command:

date +"%m-%d-%y"



Complete list of FORMAT control characters supported by date command

kontinue reading…

Tags: , , ,