I recently tried to run a Python script on one of my Linux boxes and received the following error.
"bash: ./count.py: /usr/bin/python^M: bad interpreter: No such file or directory"
What I discovered is that this happens when you create a script on Windows, which I had done, and then try to run it on Linux. However, this is an easy problem to solve.
Run the dos2unix command against the file and your scripts should function correctly.
"dos2unix filename"
Thursday, December 5, 2013
Bad Interpreter Error
Wednesday, November 13, 2013
Wireshark with root privileges
On my Ubuntu 12.04 box I wanted to be able to capture packets with Wireshark using my standard login. To do this as a standard user simply complete the following steps.
From the terminal
- sudo dpkg-reconfigure wireshark-common
- select yes to the question "Should non-superusers be able to capture packets?"
- sudo adduser $USER wireshark
- logout
Once you login you should be able to capture packets with Wireshark.
Monday, September 9, 2013
Show SFP modules installed in a Brocade Ethernet switch
Determining which SFP modules you are using in your Brocade Ethernet switches is pretty straight forward. Simply issue the following command from the CLI.
show media
This will return information similar to the following:
Port 7: Type : 10GE SR 300m ((SFP+))
Vendor: BROCADE Version: A
Part# : 57-0000075-01 Serial#: xxxxxx
Friday, September 6, 2013
Virtual PC and Windows 8
If you want to run virtual machines under Windows 8 you no
longer need Virtual PC.
Simply go to "Turn Windows features on or off" and
enable Hyper-V.
Once that is complete you can launch Hyper-V Manager and
start creating virtual machines. One
thing to note, you will have to go into Virtual Switch Manager and create a
virtual switch for your virtual machines to connect to. This is different from Virtual PC when you
could just select the adapter you wanted to use.
Monday, August 26, 2013
Force users to login to NTOP
If you spin up NTOP out of the box on a Debian or Ubuntu server anyone that connects to the site can view the data. You can easily protect this data by forcing users to authenticate when they access the site by using the following simple instructions.
Go to Admin > Protect URLs
Select Add URL
Do no add anything to the URL, select the Authorized Users, and select Add URL
You should now be prompted to login whenever you access your NTOP server.
Friday, August 2, 2013
Free security scan tool for Windows
Don't let a lack of budget stop you from running security scans against your Windows computers. Microsoft provides a free tool called the Microsoft Baseline Security Analyzer (MBSA), that does a pretty good job.
It checks for missing patches, account issues, and configuration issues with Microsoft apps such as IIS and SQL. It then provides you with some remediation steps for the potential problems it finds.
You can download the MBSA here.
Friday, July 26, 2013
Use PowerShell to delete old files
Here is a simple way to use PowerShell to delete old files. In my
example I want to delete files older than 365 days off of a remote
server.
dir \\SOME_HOSTNAME\SOME_FOLDER -recurse | WHERE {($_.CreationTime -le $(Get-Date).AddDays(-365))} | Remove-Item -Force
* Make sure you test before deploying in production
Wednesday, July 3, 2013
License VMware Workstation from CLI
I installed Fedora 19 on my laptop and decided to install VMware
Workstation 9 on it as well. The install was straight forward, but I
could not enter the license key through the GUI. However, no need to
panic, doing this from the CLI is pretty straight forward.
Provided you performed the default install you should be able to use the following:
/usr/lib/vmware/bin/vmware-vmx --new-sn xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Thursday, May 30, 2013
PXE Boot using DHCP
If you need to be able to PXE boot devices accross subnets to utilize applications such as SCCM you can do so by utilizing scope options within your DHCP servers.
Option 66 contains the ip or FQDN of your WDS server
Option 67 contains the name of your bootfile i.e. SMSBoot\x86\wdsnbp.com