Load all available PowerShell Modules

January 12, 2016 Leave a comment

I’ve had to look this tip up a number of times, so here it is.

Say you are running PowerShell on a Windows server, however it does not automatically load all available modules and you need one for a specific script you’ve got.  Load all available PowerShell modules on a Windows server by running this command:

Get-Module -ListAvailable | Import-Module

From the “Hey, Scripting Guy! Blog.”  Thank you!

Categories: how do I?, windows Tags:

Deploy Node.js to Fedora 18

March 2, 2013 Leave a comment

Per github wiki for node.js, Fedora 19 will have node.js included.  However, to obtain node.js in Fedora 18, do the following:

sudo yum --enablerepo=updates-testing install nodejs npm

 

-Xrs parameter in JAVA_OPTIONS in Solaris

June 28, 2011 Leave a comment

On one of my web servers I use the “-Xrs” parameter in the JAVA_OPTIONS on a Solaris server.  This tells the JVM to ignore any system shutdown requests.  This prevents the JVM from shutting down in the event there is a system panic which may not otherwise cause a system crash.   See the JVM parameters page for Solaris for more details.

Categories: solaris 10, weblogic

Grep through a unix directory with a long list of files

June 16, 2011 Leave a comment

Sometimes when attempting to grep through the files in a directory, there are so many files in the directory that grep returns an error indicating the argument list is too long.  Fix this by using xargs.

find ./ -print | xargs grep -l <your_string>

Categories: how do I?, solaris 10, useful

Count number of files in a unix directory

June 16, 2011 Leave a comment
ls -1 | wc -l
Categories: how do I?, solaris 10, useful

Edit nofiles

May 2, 2011 Leave a comment

Running an Oracle ODI installer on a CentOS vm, I encountered an error of the type:

checking for hardnofiles = 4096; found hardnofiles = 1024 Failed
checking for softnofiles = 4096; softnofiles = 1024 Failed

The fix was to edit my/etc/security/limits.conf file:

* soft nofile 16384
* hard nofile 65536

Categories: Uncategorized

Add/view/delete an entry to iptables to enable Apache/VNCServer/FTP, etc.

April 28, 2011 Leave a comment

The default CentOS 5.6 firewall configuration does not allow Apache httpd traffic on port 80.  In order to open the port for utilization, a change must be made to the firewall configuration.

iptables -I INPUT -p tcp -m tcp ––dport 80 -j ACCEPT

To open a hole for VNCServer (running on display 20):

iptables -I INPUT -p tcp -m tcp ––dport 5920 -j ACCEPT

To open a hole for VNCServer (running on display 20) web base interface:

iptables -I INPUT -p tcp -m tcp ––dport 5820 -j ACCEPT

To display the openings you’ve created in your firewall:

iptables -L INPUT -n ––line-numbers

To remove a line entry from your iptables file (for example, entry #3):

iptables -D INPUT 3

Notes:

There are two dashes in front of parameters such as “––line-numbers” and “––dport.”

The iptables service must be saved, and restarted before changes take effect.

service iptables save

service iptables restart