Friday, 31 August 2012

Mysql phpmyadmin search replace

phpmyadmin syntax, note no speech marks on tablename or field name

UPDATE tablename SET field = REPLACE ( 
field, 
'HLLOWRDCHG', 
'HELLOWORLDCHANGE');

Tuesday, 28 August 2012

VI editor tricks

Word count


http://vim.wikia.com/wiki/Word_count

find text, then replace part of text

There is another form of line addressing called global addressing. It is similar to the % (all lines) address, but allows you to limit the search and replace action by specifying certain text that must appear in a line before the search and replace action is applied to it. An example is show below. The syntax shown below would read "for all lines containing `some text', search for `search text' and replace any instances with `replacement text.'"

:g/some text/s/search text/replacement text/

other stuff


:%s/test/mytest/gIc

arguments g=global, I=dont ignore case, c=confirmation required

regex

:%s/[A-Z]', '2'//gn

count occurences of: letter then comma then space then apostrophe then 2 apostrophe


Thursday, 7 June 2012

Interesting Language

http://cultureofsoccer.com/2007/06/19/the-sapir-whorf-hypothesis-and-how-language-affects-our-understanding-of-soccer/

In the Japanese language, for example, the word for self is jibun. This word is made up of two parts, ji, which means part, and bun, which means group. Put together, jibun, the Japanese word for self, literally means part of a group.
This may seem like mere semantical nitpicking until one also considers the way Japanese people typically conceive of the self. Unlike Western culture, which is more inclined to view an individual on his or her own, Japanese culture views people always within the context of a group. (For further reading on this topic, I recommend Japanese psychoanalyst Takeo Doi’s book The Anatomy of Dependence.)

Thursday, 26 April 2012

Installing Sophos endpoint on Windows 7

Issue installing sophos on windows 7 pc, made sure the remote registry service was running, looked round sophos site, but so many misleading answers, finally found this,which mentions file sharing within the windows firewall settings:

http://www.reading.ac.uk/internal/its/help/its-help-pcsecurity/its-sophos-troubleshoot.aspx

section: Updating Has Never Worked Since Installing

Slightly different for me, I typed 'firewall' in search/run bar on start menu. Selected 'Windows Firewall', (not advanced security).

On left selected 'Allow program or feature through windows firewall'

Ticked 'File and printer sharing'
Works now!

P.S
Had another issue after upgrading endpoint to 5.2
Excerpt from: http://downloads.sophos.com/tools/on-line/deployment_guide/en-us/index.html
(on right hand side Enterprise console 5.2)

'Overview of required settings
The table below gives an overview of all the settings required to protect and manage an endpoint computer. If you are familiar with creating and configuring Group Policy Objects (GPOs) you can use the table below to quickly configure your network. If not, follow the detailed instructions below the table.
Requirement Details
Windows Firewall Rules
 File and Printer Sharing (SMB-In)
Remote Scheduled Tasks Management (RPC)
Sophos Remote Management (TCP 8192 and 8194 Inbound and Outbound)

Services Task Scheduler (Started)
Windows Installer (not Disabled) '

For me the Windows Installer service needed to be started! It was not disabled, it was just set to manual and in stopped state.

Tuesday, 3 April 2012

IIS 7 FTP firewall woes sorted

Note:- First I was following this:
http://learn.iis.net/page.aspx/301/creating-a-new-ftp-site-in-iis-7/

which is similar if not the same to the preceding chapters of the article linked below.

but i did find there was an issue and it was helpful to use this info: http://forums.iis.net/t/1161450.aspx
[quote]D'oh. Instead of setting up a binding to 127.0.0.1 i set up a binding to ::1 and it immediately started working. In the tutorial 127.0.0.1 seemed to work, so i'm not sure whether the tutorial is wrong or it's just a simple setting somewhere. Anyways it's working fine now. [/quote]  

'All Unassigned' worked also for me   

Bindings found by right clicking   Ftp Site -> Edit Bindings  

anyway... back to it...
     

Using Windows Firewall with non-secure FTP traffic

From Article:
http://learn.iis.net/page.aspx/309/configuring-ftp-firewall-settings-in-iis-7/


To configure Windows Firewall to allow non-secure FTP traffic, use the following steps:

  1. Open a command prompt: click Start, then All Programs, then Accessories, then Command Prompt.
  2. To open port 21 on the firewall, type the following syntax then hit enter:
    netsh advfirewall firewall add rule name="FTP (non-SSL)" action=allow protocol=TCP dir=in localport=21
  3. To enable stateful FTP filtering that will dynamically open ports for data connections, type the following syntax then hit enter:
    netsh advfirewall set global StatefulFtp enable

Important Notes:

  • Active FTP connections would not necessarily covered by the above rules; an outbound connection from port 20 would also need to be enabled on server. In addition, the FTP client machine would need to have its own firewall exceptions setup for inbound traffic.
  • FTP over SSL (FTPS) will not be covered by these rules; the SSL negotiation will most likely fail because the Windows Firewall filter for stateful FTP inspection will not be able to parse encrypted data. (Some 3rd-party firewall filters recognize the beginning of SSL negotiation, e.g. AUTH SSL or AUTH TLS commands, and return an error to prevent SSL negotiation from starting.)

Using Windows Firewall with secure FTP over SSL (FTPS) traffic


The stateful FTP packet inspection in Windows Firewall will most likely prevent SSL from working because Windows Firewall filter for stateful FTP inspection will not be able to parse the encrypted traffic that would establish the data connection. Because of this behavior, you will need to configure your Windows Firewall settings for FTP differently if you intend to use FTP over SSL (FTPS). The easiest way to configure Windows Firewall to allow FTPS traffic is to list the FTP service on the inbound exception list. The full service name is the "Microsoft FTP Service", and the short service name is "ftpsvc". (The FTP service is hosted in a generic service process host (Svchost.exe) so it is not possible to put it on the exception list though a program exception.)

To configure Windows Firewall to allow secure FTP over SSL (FTPS) traffic, use the following steps:

  1. Open a command prompt: click Start, then All Programs, then Accessories, then Command Prompt.
  2. To configure the firewall to allow the FTP service to listen on all ports that it opens, type the following syntax then hit enter:
    netsh advfirewall firewall add rule name="FTP for IIS7" service=ftpsvc action=allow protocol=TCP dir=in
  3. To disable stateful FTP filtering so that Windows Firewall will not block FTP traffic, type the following syntax then hit enter:
    netsh advfirewall set global StatefulFtp disable

Thursday, 22 March 2012

windows 7: Load a network driver in repair mode

http://support.microsoft.com/kb/923834

Manually load the network driver, and then verify that it is the correct driver. To do this, follow these steps:
  1. At a command prompt, type the following command, and then press ENTER:
    drvload driver.inf
    Notes
    • Driver.inf is the name of the third-party network driver.
    • You have to specify the full path and the name of the driver. For example, if Driver.inf is on a CD, and the CD drive is drive D, type the following command, and then press ENTER:
      drvload.exe d:\Folder\Driver.inf
  2. Type wpeutil InitializeNetwork, and then press ENTER.
  3. To verify network connectivity, type ipconfig /all.

    Note The ipconfig /all command generates a detailed configuration report for all interfaces that include any remote access adapters.

Wednesday, 21 March 2012

Windows disk partition from command line

Windows disk partition from command line

Type: diskpart
and press Enter

Type: select disk 0 (zero)
and press Enter

type: list volume
and press Enter