How to connect to a EC2 instance using Powershell

Hi guys, I don’t exactly know why but apparently there are no articles out there, with a good step by step guide to connect from your local pc to a Windows Server 2012 R2 instance hosted on Amazon AWS on EC2, this short article aims to fill this gap:

ASSUMPTIONS :

  • This article assumes some knowledge of AWS, the EC2 service and of Windows Server 2012 but nothing is complicated and I’ve added many links with large documentation
  • The Powershell comunication uses on the WinRM protocol, therefore  it needs a specific port reachable 5985 TCP  on the server (be advised, the default transport protocol will be the insecure HTTP).
  • The WinRM service is enable by default on WIN2012 R2 but the default Windows Firewall configuration is to allow connections on the 5985 port only from the same subnet of the machine, therefore we need to login to the machine using RDP an modify the default configuration of that firewall rule.
  • If your pc (the client !) is not part of the domain of the remote server you need to add the remote server into the list of your trusted hosts on YOUR pc (covered below).

GUIDE :

  1.  Deploy the VM with Windows Server 2012 ( docs )
  2. Modify the security group of the instance, adding a rule to open the port 5985 TCP from your IP/ or from anywhere ( docs )
  3. Wait a few minutes for the machine to boot up completely and then connect to it using the Remote Desktop protocol (RDP), aka the usual way to connect to win istance on EC2 ( docs )
  4. Modify the Windows firewall configuration to allow incoming connections to the port 5985 from any ip (or as you please:) ), to do so you can : Control Panel -> Windows Firewall -> Advanced Settings -> Inbound Rules -> “Windows Remote Management (HTTP-In)” where the profile is PUBLIC (make sure to choose the right one !) -> Properties -> Scope -> Remote IP Addresses -> Any IP Address (or know better ! )

    OR

    Use this simple Powershell command:
    Set-NetFirewallRule -Name “WINRM-HTTP-In-TCP-PUBLIC” -RemoteAddress “Any”

  5. Reboot the Windows Firewall service ( don’t ask me why, but sometimes the rules are not picked up until a reboot of the service, I’ve witnessed that myself ) (docs)
  6. Then make sure that the WinRM protocol is working correctly on the server machine running this comand in a shell (not really needed, just to make sure it works)  Enable-PSRemoting –force

  7. Then move to your local machine and make sure the WinRM service is working here as well, in a privileged shell:
    Start-Service -Name Winrm
  8. Then add the remote host as a trusted host, running this command into a privileged shell :
    SetItem WSMan:\localhost\Client\TrustedHosts Value “XXXXXXXXX.eu-west-1.compute.amazonaws.com”
    or, possibly smarter maybe not super secure, use a wildcard :
    SetItem WSMan:\localhost\Client\TrustedHosts Value “*”

  9. Then connect to the remote machine using one of the various options provided by powershell such as :
    Enter-PSSession -ComputerName “XXXXXXX.eu-west-1.compute.amazonaws.com” -Credential $(Get-Credential)
    Inserting the login credentials of the remote machine when requested to ( docs )

NOTES: 

The WinRM service can be configured server side to use the more secure HTTPS on port 5986 or a COMPATIBLITY MODE running on port 80, used usually for firewall related issues ( docs).

Older versions of Windows have different requirements to set up Powershell Remoting / WinRM ( docs ).

And, obviously, this guide is generazible to many other IaaS services (Azure, Digial Ocean).

Hope this helps somebody !

ciAO!

how to solve (some) graphical issues with putty, UTF8, and ncurses

Hello everybody,

I’m writing this article to help all those people that may have had problems with text garbled, mismatched or other kind of graphical issues with all those software that uses the famous ncurses libraries (libncurses5). It all started when I was using (via puTTY) my favorite command line log parsing tool: the great  multitail (go out there and take it if you don’t know it) I started noticing some odd errors: part of the text was garbled, some of the lines were wrong in size or were substituted by wrong characters, as you can see in the screenshot:

screenshot
multitail in a centOS environment

This problem happened when using puTTY on a CentOS 6.6 system, with locale set on UTF-8,  libncurses version 5.x and multitail at 6.4.1

This is the result of multiple problems and some steps are required to fix all the issues :

  1.  Download the latest version of puTTY (0.64 as of today)
  2. Make sure that under Windows -> Translation  and Connection -> Data you have everything as in the images :
    Remote character set: UTF-8 and "use Unicode line drawing code points"
    Remote character set: UTF-8 and “use Unicode line drawing code points”

    Terminal-type string: putty
    Terminal-type string: putty
  3. Then, you have to set an environment variable to tell the ncurses libraries to use UTF-8 :

export NCURSES_NO_UTF8_ACS=1

you should also make it stick (echo export NCURSES_NO_UTF8_ACS=1 >> ~/.bashrc )

This should solve all your issues with UTF-8 and the ncurses libraries.

Btw, this short guide wouldn’t have been possible without the help of Folkert…so thank you !

As usual, I hope this was useful to somebody.

How to have a working Internet key Huawei Vodafone K4606 on Mac osX Yosemite 10.10

Hello guys, these days the K4606 Vodafone internet key seems not to be working on Yosemite, but the issue is not with the hardware itself but with the Vodafone Mobile Broadband (AKA the software provided) sofware onboard which sadly crases whenever loaded into Yosemite. At the time I’m writing not even the latest beta available on the Vodafone website is working Software Mac: v. 4.10.04 ) Luckily for everybody the hardware manufaturer has relased an updated version of their own software which can be customized to suit the Vodafone connection (or virtually ANY connection) and I’ve made a short guide which you can follow :

  • Remove all the Vodafone remaining software on your mac (use the provided tool into the Vodafone Utilities folder)
  • Find a way (an older pc,a friend, your own cellphone or else) to REMOVE the PIN request from the SIM card of the Internet Key <- (SEEMS REALLY TO BE NECESSARY) 
  • Download the software “Mobile Partner” from their website :

    Mac-V200R003B015D11SP00C983(for Mac10.10)

  • Extract the archive into a folder ( you might need winrar as it is provided into a .rar archive
  • Extract once again the zip file
  • Install the software completely ( you can easily follow the instructions provided with the software, they’re rich of screenshots)
  • Once you’ve done that make sure that the sofware is loaded and plug in the internet key
  • make sure to EJECT the Vodafone virtual drive if it happens to load on the top right corner of the screen
  • FORGET ABOUT THE MOBILE PARTNER SOFTWARE IN THE BACKGROUND (I know, it sounds strange but these Internet keys are VERY CLEVER and MAC OS X is doing its best here as well so FORGET about it)
  • From the System Preferences, open NETWORK
  • If you can see the Internet key (named HUAWEI) that’s good just wait !
  • Otherwise choose the “+” button on the left corner of the Network Preferences window and choose “Huwaei” from the list
  • Make sure to have “DHCP” selected
  •  – > WAIT  <- (wait as you waited before, like MINUTES), to see the small icon on your new connection turning green from yellow
  • Open your web browser (IE, Chrome, Firefox, whatever) and go to any website
  • Any website should EITHER WORK ALREADY or move you to the Vodafone landing support webpage where you will be able to see your account details and click on CONNECT if you need to (depending on your plan / country)

That’s it.  Pretty straightforward once understood isn’t it ? As many things in life. UPDATE : This guy posted a COMPLETE guide for many other modems K4203 K4606 K5150 and Huawei E160 E172 K3520 K3715 K3765 K3772 K4505 K4510 K4511 K4605 K5005 ZTE K3565-Z K3772-Z K4505-Z unfortunately is in german and not very user friendly but it’s full of screenshots :

http://hope.ly/1ANM1xD

The idea here is to use the drivers provided with the Vodafone Mobile Broadband software and follow a similar procedure to avoid the Vodafone software (not working on Yosemite) and use the OsX sofware. It should work as well.

ciAO!

Guide: Intel 82573L gigabit ethernet with Ubuntu 11.04 and fix PXE-E05

hello guys,

big post today. I’ve finally updated my Ubuntu machine to the latest version 11.04 Natty Narval…everything works out pretty well execpt for the wired ethernet controller… I’m using the

“Intel Corporation 82573L Gigabit Ethernet Controller”

this controller isn’t manageable via the usual Ubuntu Network Manager nor it’s listed in the output of the ifconfig and it’s status is unclaimed

$ sudo lshw -C network
*-network UNCLAIMED
description: Ethernet controller
product: 82573L Gigabit Ethernet Controller

There is no problem at all with Windows 7 or my old Ubuntu release 8.x , the card is fully working.

In the meantime I have noticed a long time recurring error (it was there for a long time before the  11.04) at the computer boot time (BIOS time),  looking like a bootstrap error :

“Initializing Intel Boot Agent GE v.1.2.28 PXE-E05: LAN adapter’s configuration is corrupted or has not been initialized. The Boot Agent cannot continue.”

the linux log messages helped me a little

$ dmesg | grep e1000
[ 0.267811] pci 0000:01:00.0: reg 18 32bit mmio: [0xee100000-0xee10ffff]
[ 0.268161] pci 0000:00:01.0: bridge 32bit mmio: [0xee100000-0xee1fffff]
[ 0.346430] pci 0000:00:01.0: MEM window: 0xee100000-0xee1fffff
[ 0.346978] pci_bus 0000:01: resource 1 mem: [0xee100000-0xee1fffff]
[ 0.918428] e1000e: Intel(R) PRO/1000 Network Driver – 1.0.2-k2
[ 0.918432] e1000e: Copyright (c) 1999-2008 Intel Corporation.
[ 0.918486] e1000e 0000:02:00.0: Disabling L1 ASPM
[ 0.918510] e1000e 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 0.918554] e1000e 0000:02:00.0: setting latency timer to 64
[ 0.918766] e1000e 0000:02:00.0: irq 29 for MSI/MSI-X
[ 0.990779] e1000e 0000:02:00.0: PCI INT A disabled
[0.990781] e1000e 0000:05:00.0: (unregistered net_device): The NVM Checksum Is Not  Valid                                                                                                                                                                                                                 [0.990788] e1000e: probe of 0000:02:00.0 failed with error -5

I have also been able to understand that this problem is not limited to the 82573L card but is common for a large number of intel ethernet cards (that is why you can easily understand the driver’s blacklisting in the old linux distributions) : 82563, 82566, 82567, 82571, 82572, 82573, 82574, 82577, 82578, 82579,  or 82583 -based.

So what is going on ? It looks like that the nework adapter’s (82573L) EEPROM is broken, unfixed and a little messed up, (error PXE-E05) this problem creates a checksum error for the NVM (The NVM Checksum Is Not Valid) that breaks the Ubuntu driver loading  therefore the eth0 alias is not created and there isn’t a manageable ethernet adapter for the Ubuntu network manger.

Windows simply doesn’t check the NVM checksum, it uses the card anyway and everything works fine.

IMHO Intel messed up a little with the 82573 controller there are too many similar errors out there, it seems it happens when there is a sudden power outage during LAN card bootime…totally nonsense !

Anyway, we need to fix this !!! As you can easily understand the idea behind this guide will work  for many others Intel controllers from the same family: I’m unable to test them but it’s probably worth giving it a shot !

And here it’s the guide…it’s not as long as it seems :

We need to remove the old 82573L driver, install the updated 82573 network controller driver, create a MS DOS boot pen drive, reboot, flash the card eeprom, and reboot again (there are a lot of subguides to ease the process for newbies USE THEM)

open the terminal ( https://help.ubuntu.com/community/UsingTheTerminal )

$ sudo rmmod e1000e                       # unload the old driver module

$ sudo rmmod e1000                        # unload the old driver module (errors are OK)

$ sudo rm /lib/modules/2.6.38-8-generic/kernel/drivers/net/e1000e/ -rf                  # remove old drivers (errors are OK)

$ sudo rm /lib/modules/2.6.38-8-generic/kernel/drivers/net/e1000/ -rf                  # remove old drivers (errors are OK)

download and extract to your home directory the latest intel drivers from their site ( http://bit.ly/ipbZ5W )

make sure you have installed build-essential ( http://bit.ly/yS5oW )

terminal again and cd to your home directory

$ cd       # to your home directory

$ cd e1000e-1.3.17/src                          #to the extracted drivers directory

$ sudo make install                                 #to install the drivers ( no errors on this side)

now we need to go to the intel site, download and extract the Intel(R) Ethernet Connections Boot Utility, Preboot images, and EFI Drivers ( http://bit.ly/jatTVE )        then prepare a MSDOS bootable pen drive and copy the extracted files we just downloaded to the pen drive.

Several ways to create a bootable MSDOS pen drive the Windows way  (PREFERRED) and the Linux1 , Linux2 and Linux3  way (should I use now the saxon genitive, now ? ) choose your favorite one but always  REMEMBER TO PUT THE EXTRACTED FILES TO THE PEN DRIVE.

Now go reading the important NOTE at the end of the page containing the disclaimer !

Now boot using the pendrive ( SUBGUIDE ) and assuming you’re at the command prompt:

c:\>  cd bootutil                        #go to the bootutil directory

c:\>  bootutil -defcfg          #force bootutil to load the default PXE configuration into the controller

# Georgi says ” bootutil -nic=1 -defcfg” it’s better. Try if the other returns an err

after that reboot the pc, and go back to Ubuntu.

Now everything should be working fine.

DISCLAIMER: You probably need to know that the Intel(R) Ethernet Connections Boot Utility WAS NOT designed to be used with on board (also know as OEM) lan cards (is for the PCI cards) therefore there is no sure way to predict it’s interactions with others on board components like USB or SOUND controllers.  I haven’t experienced any problem with my computer and I haven’t seen any negative review using Google (HP dv6000) but there is no way to be 100 %. What I can tell you is that procedure is the only way to make the cards working otherwise you need to buy a new external card.  Eventually use at your own risk and patrol

As usual hope this was helpful to somebody.

backup gmail to your pc

Hi guys,

I’ve been able to see many complaints about the gmail service and it’s availability…
I mean, it’s a free service and with the super cool servers that google is using we have probably nothing to worry about.

BUT

as people is use to say we’ve better be SAFE than sorry so it could be a good idea to make a complete (but disorganized) gmail backup to our computer. We probably won’t be ever able (or requested) to roll back our backup but it will stay available on our hard disk. (is “available on” correct ?!? )

We could use POP3 and download every single message to our mail client and then save but it’s insanely long and boring, so…

there is a program Gmail Backup (http://www.gmail-backup.com/) a very nice & easy program to backup your whole gmail account ” the ultimate one-click solution for doing backups of your GMail account.”

BACK IT UP and store the file safely on your hard disk.

As usual, hope this helps someone

Gmail NOT WORKING it’s UNAVAIABLE USE IMAP

Ok, flash post today.

Today at 1:30 AM PST Gmail suddenly stopped working. It seems it is unreachable. Google Apps linked applications are also NOT working.

FIRST A NOTICE FOR EMAIL ADDICTS : PLEASE STAY CALM . DO NOT WORRY. EVERYTHING IS GONNA BE ALRIGHT

The Google’s Gmail support team says the following :

We’re aware of a problem with Gmail affecting a number of users. This problem occurred at approximately 1.30AM Pacific Time. We’re working hard to resolve this problem and will post updates as we have them. We apologize for any inconvenience that this has caused.”

Anyway, for all those who are experiencing technical problems accessing Gmail or Gmail is absolutely not working, there is a simple workaround :

USE GMAIL VIA IMAP

What, the hell, is IMAP ?   Just don’t care ! Using gmail with IMAP means : use gmail with Outlook Express, Thunderbird, Mail, Iphone MAIL or any otherIMAP client.

These are some useful links  to configure the main mail clients with GMAIL via IMAP:

GMAIL IMAP GENERIC HELP

GMAIL IN OUTLOOK 2007

GMAIL IN THUNDERBIRD

Anyway, to configure any client with GMAIL the required settings are the following:

Incoming Mail (IMAP) Server – requires SSL: imap.gmail.com
Use SSL: Yes
Port: 993
Outgoing Mail (SMTP) Server – requires TLS: smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
Account Name: your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
Email Address: your full Gmail email address (username@gmail.com) Google Apps users, please enter username@your_domain.com
Password: your Gmail password

Anyway I’m pretty sure everything is gonna be alright in a couple of hours…

YOU, CRAZY EMAIL ADDICT STAY CALM ! STOP HITTING THE REFRESH BUTTON ! SAVE THAT F5 !

As usual hope this is helpful to somebody.

How To Boot and Run Linux from a USB Pen Drive [Easy Way]

Hello,

this time I’m gonna show you two easy ways to install and run two common linux distributions from a pen drive using both Windows Xp or Vista or a Linux Distribution, and wizard procedures. It’s like a “Live” distribution, but from a USB drive. The two distributions are Fedora Core 9 (or 8 ) and BackTrack (what is BackTrack ?!? Take a look at this ), both with the persistence feature…what is the “persistence feature” ??? Well, is the possibility to store the changes you’re making to the system (in fact, it’s NOT exactly like a Live distribution)…anyway…

Fedora Core 9 (2 Gb Pen drive is enough, 4 Gb is better )

The Windows’s Way…

1. Insert the pen drive, and make sure it’s empty

2. Download the lastest version of the “liveusb-creator” from here then extract the zip file to a directory and run ” liveusb-creator.exe ”

3. Choose the Fedora Distribution you prefer ( the 9 is really better ! ), choose the USB Drive, then the dimension of the “Persistent Overlay”, the space left to store the modifications to the system, or the files you make. (for 4 gb units, “choose the greatness”…2047 Mb, for 2 Gb… 1024 Mb…less or more… )

4. BUTTON : “Create the Live USB”

5. Wait a couple of hours…

That’s all…now you should have your distribution full working…

The Linux’s Way…

1. Insert the pen drive, mount it and make sure it’s empty

1b. Install YUM if you haven’t got it yet… (your system probably has it already installed…)

2. Open a terminal windows or get a shell, go to an empty directory ( you need a couple of Gb’s free storage space), and give

# yum -y install syslinux PyQt4 git $ git clone git://git.fedorahosted.org/git/liveusb-creator 
# cd liveusb-creator 
# ./liveusb-creator

3. Choose the Fedora Distribution you prefer ( the 9 is really better ! ), choose the USB Drive, then the dimension of the “Persistent Overlay”, the space left to store the modifications to the system, or the files you make. (for 4 gb units, “choose the greatness”…2047 Mb, for 2 Gb… 1024 Mb…less or more… )

4. BUTTON : “Create the Live USB”

5. Wait a couple of hours…

That’s all…now you should have your distribution full working…you SHOULD…this is still beta version software…so no one is really sure about that…

Backtrack 3 Final (2 Gb Pen drive is enough, 4 Gb is better )

The Windows’s Way…

1. Insert the pen drive and make sure it’s empty

2. Download the [ USB Version (Extended) ] from the official site

3. Extract the whole .iso file to the USB Drive (feel free to use Winrar )

4. Then open the root folder of the drive (ex. G:\ ), go to “boot” folder

5. Run bootinst.bat and follow the onscreen istructions (just press ENTER if everything is ok )

6. That’s all…. should be working…

The Linux’s Way…

1. Insert the pen drive, mount it and make sure it’s empty

2. Download the [ USB Version (Extended) ] from the official site

3. Extract the whole .iso file to the USB Drive (feel free to use the extractor you prefer…like Ark)

4. Then open the root folder of the drive (ex. /home/media/usb1 or /mnt/sda1 ), go to “boot” folder

5. Run bootinst.sh (double click on the icon or “./bootinst.sh” to the shell) and follow the onscreen istructions (just press ENTER if everything is ok )

6. That’s all…. should be working…

Hope this was useful…. Happy Holidays…

How to update Drupal from 5.x to 5.x

Well,

this is a VERY SIMPLE issue… and you can find MANY others guides around, but let me just tell you :

1_

Backup all your web site files and export all your database tables …

2_

donwload the lastest 5.x version

3_

extract the .tar.gz file and, in the meantime login to get the directories of your website (usually using the ftp service)

4_

copy (overwrite) all the files extracted to your root directory

5_

eventually, change you permissions (it depends on your server configuration)

6_

go to http://www.youwebsite.com/update.php & run the database update script…

fine ! that’s all ! so simple ! you did it !!!

BUT

if you should get THIS error message

“The following error must be resolved before you can continue the installation process:
register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled.”

(or your websites simply shows you an error message relate to php configuration)

probably the answer is to make a call named “php.ini“, into the root directory of your website, with those simple words inside

register_globals = OFF
memory_limit = 16M

easy, isn’t it ???

As usual hope it is useful to somebody…

How-to Install Windows Xp on HP Pavilion dv6236EA

Hello,

this one is a VERY BRIEF guide about the installation of Microsoft Windows Xp on a HP Pavilion dv6236EA system…

now, first of all you need to DISABLE the “SATA Native Mode” into the BIOS (press F10 at computer boot)…

then you can make a common XP installation…then…this is the *needed* drivers list:

(Ah, the Softpaq packages are the installation programs for the drivers coming from HP)

VIDEO

GeForce Series Video Driver (Softpaq)

AUDIO — MODEM

Microsoft UAA Driver (Softpaq)

then

Microsoft KB888111 Hotfix (Original Microsoft Hotfix)

then

Conexant HD Audio DRIVER (Softpaq – comes with the MODEM driver )

CHIPSET

Intel® Chipset Software Installation Utility

WI-FI

Dell Package (Follow the extraction directory, then go into “XP”, this is where the working drivers are located)

TOUCHPAD

Synaptics Touchpad

ETHERNET (LAN)

Lenovo Package (It uses the same interface)

CARD READER (SD –😄 – MMC)

Ricoh 5-1 Card Reader Driver (Softpaq Package)

WEBCAM

Webcam 1.3 Mp (Softpaq)

QUICKPLAY BUTTONS

Driver & Application (Softpaq)

After the installation of these drivers, EVERYTHING is working fine for me…

Every device is correctly working…

Hope it was useful…

:-)

P.S.

Q: Why you are not talking about Linux?

A: Because, I dont’want to be stuck in a moment I can’t get out of…

😉

Compiz-fusion problems with 7.10 “Gutsy Gibbon” related to update from 7.04

Okay, I’m still not sure, I did not found in the Web many pages refering to this problem, but it seems there is a problem with Compiz…

The problem applies to Ubuntu 7.10 “Gutsy Gibbon” if you have upgraded from 7.04 “Feisty Fawn” with Compiz-Fusion already installed using the wizard procedure, this issue can lead to:

Compiz NOT WORKING

The Compiz Configuration Settings Manager (ccsm) can stop working: can’t start.

HOW TO SOLVE THE PROBLEM:

The solution is very easy, just download and run this .deb package from Gutsy Official Repository to update (or re-install)

Gutsy Official Repository Link

Then, reboot.

Now use Compiz as usual, should be working now…

If something goes wrong, just REMOVE Compiz (sudo apt-get remove compiz*) the INSTALL it again using this simple guide.

Please, take care of this link too:

http://kevin.vanzonneveld.net/techblog/article/upgrade_to_ubuntu_gutsy_with_compizfusion/

There is is a guide to update your system from Feisty to Gutsy with Compiz already installed.

As usual hope it is useful to somebody…