HOWTO: Use iptables with CentOS 7

Thanks to Rackspace Community for this nice howto.

Starting with RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. As such, you will either need to use firewall-cmd commands or disable firewalld and enable iptables. If you prefer to use the classic iptables setup, then this article will show you how to do just that.

https://community.rackspace.com/products/f/25/t/4504

Annunci
Pubblicato in IT, linux | Contrassegnato , | Lascia un commento

Get list of running processes on remote Windows machine

The tasklist /S <remotemachine> command will output a list of all running processes on remote machine.

Or better, in Powershell, you could use: get-process or get-wmiobject WIN32_PROCESS (gwmi is an alias for get-wmiobject)

If you want CPU usage in percentage, use gwmi Win32_PerfFormattedData_PerfProc_Process

To sort output by CPU usage

PS C:\> gwmi -Computername <remotemachine> Win32_PerfFormattedData_PerfProc_Process | sort PercentProcessorTime -desc| ft name, PercentProcessorTime, IDprocess -auto

Credits: http://superuser.com/users/50173/nixda at http://superuser.com/a/630578

Pubblicato in IT, powershell, windows | Contrassegnato , , | Lascia un commento

Install VMware tools in Linux guest (RedHat Enterprise Linux or Centos)

I often have to install VMware tools on linux guests, so I wrote down a very basic bash script to automate installation. You only have to:

  • copy-and-paste following lines into a text file on your Linux vm (let’s say tools_install.sh)
  • make it executable with chmod +x tools_install.sh
  • fill out a few variables (VMWARE_VERSION, OS and ARCH)
    VMWARE_VERSION is the ESXi version. For example: 5.1latest, 5.5 or 5.0u1.
    OS is rhel5 or rhel6 (also for Centos)
    ARCH is the architecture option. For 32-bit is i386 and for 64-bit is x86_64.
  • run it with ./tools_install.sh

Hope it helps!

#!/bin/bash
VMWARE_VERSION="5.1latest"
OS="rhel6"
ARCH="x86_64"
yum -y install wget

wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
rpm --import VMWARE-PACKAGING-GPG-DSA-KEY.pub
rpm --import VMWARE-PACKAGING-GPG-RSA-KEY.pub
cat <<EOF > /etc/yum.repos.d/vmware-tools.repo
[vmware-tools]
name=VMware Tools
baseurl=http://packages.vmware.com/tools/esx/$VMWARE_VERSION/$OS/$ARCH
enabled=1
gpgcheck=1
EOF
yum update
yum -y install vmware-tools-esx-kmods vmware-tools-esx-nox

Pubblicato in IT, linux, vmware | Lascia un commento

how to find dns device names from Citrix udadmin output

With udadmin.exe (a command line Citrix XenDesktop tool to find licenses usage data) when you list all licensed users and devices (with -list -a switches), devices show up in an 8-character alpha-numeric format, not real DNS device names.

Thanks to Quazi Imtiaz form Citrix forums (http://discussions.citrix.com/topic/294161-need-help-with-udadmin-output-device-names/) i found that you have to use this powershell command

Get-BrokerDesktop -LicenseId "C8FC0276" | Select MachineName

where C8FC0276 is the id in udadmin output.

You get device dns name in the format Domain\VirtualDesktopName

Pubblicato in citrix | Contrassegnato , , , | Lascia un commento

What is the URL for a CentOS 6 netinstall?

When installing Linux Centos 6.x netinstall (minimal CD that downloads packages only on-demand), at the beginning of the setup, after network configuration, it prompts you for a “URL setup” (the address of a centos mirror to download installation from).

centos_url_setup

I usually use mirror located at switch.ch (Switzerland). I suggest this mirror if in Europe.

Here are the links

for x64:

http://mirror.switch.ch/ftp/mirror/centos/6/os/x86_64/

for x86:

http://mirror.switch.ch/ftp/mirror/centos/6/os/i386/

Hope it helps!

 

Pubblicato in IT, linux | Contrassegnato , , , , , | Lascia un commento

How do I enable ownership of an external drive?

Open Disk utility, copy the name of the drive – ex: “MyBackup”
In Finder search and open terminal.
In terminal, it may ask for user name and password – enter them.
Copy and paste this:

sudo /usr/sbin/vsdbutil -a /Volumes/MyBackup

(Change the name from MyBackup to the actual name of the drive)
….it may ask for user name and password – enter them.

When you go back to Disk Utility and get info on your disk, it should have changed ownership status (Enable owner: yes)

Pubblicato in IT, mac | Contrassegnato , , , , | Lascia un commento

Vim Syntax highlighting for Apache Config Files

thanks Brad Montgomery for this!

https://bradmontgomery.net/blog/vim-syntax-highlighting-for-apache-config-files/

Basically, Vim does syntax highlighting for apache files based on their path. To get vim to recognize the files in the apache_configs directory, you need to edit (or create) ~/.vim/filetype.vim and add the following:

au BufNewFile,BufRead ~/path/to/apache_configs/* setf apache
Pubblicato in IT, linux | Contrassegnato , , , | Lascia un commento