Windows Command Prompt Recursively Delete .DS_Store

del /s /q /f /a .DS_STORE

Advertisements

We Got Hacked By… Bingbot?

Actual line from server log file (host ip and domain name altered):

Line 6618: 2017-01-30 21:12:44 W3SVC923663 WEB728 123.123.123.123 GET /companies.asp remove=1723 443 – 157.55.39.69 HTTP/1.1 Mozilla/5.0+(compatible;+bingbot/2.0;++http://www.bing.com/bingbot.htm) – – http://www.website.com 200 0 0 24266 352 2515

Web application written using classic asp on IIS7 with SQL Server and hosted remotely.

  • No robots.txt.
  • Forced login only on the index.asp page.
  • All other pages don’t check for authorization.
  • All pages include navigation.asp.
  • Search.asp has <a href=’search.asp?selection=’all”>search all</a>.
  • Companies.asp has <a href=’companies.asp?remove=123′>delete</a>

True story. Today.

Reset 10.5 Leopard & 10.6 Snow Leopard password

Reset 10.5 Leopard & 10.6 Snow Leopard password

  1. Power on or restart your Mac.
  2. At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
  3. This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
  4. Type mount -uw / and press Enter.
  5. Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist and press Enter.
  6. Type ls /Users and press Enter. This lists all of the usernames on the computer – helpful if you don’t know or remember what these are.
  7. Type dscl . -passwd /Users/username password and replace “username” with one of the users displayed in the previous step. Replace “password” with a new password of your choice. Press Enter.
  8. Type reboot and press Enter.

http://www.macyourself.com/2009/08/03/how-to-reset-your-mac-os-x-password-without-an-installer-disc/ 

 

SQL Select Beginning and End of Months

select
CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(getdate())-1),getdate()),101) as [Beginning of this month]
,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))),DATEADD(mm,1,getdate())),101) as [End of this month]

, CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))-1),DATEADD(mm,1,getdate())),101) as [Beginning of next month]
,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))),DATEADD(mm,2,getdate())),101) as [End of next month]

, CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))-1),DATEADD(mm,2,getdate())),101) as [Beginning of two months from now]
,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))),DATEADD(mm,3,getdate())),101) as [End of two months from now]

, CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))-1),DATEADD(mm,3,getdate())),101) as [Beginning of three months from now]
,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,getdate()))),DATEADD(mm,4,getdate())),101) as [End of three months from now]

Connect to a Server on a Different Network in Windows 10

My work PC’s IP address is 192.168.1.99 and a server that I recovered from a co-location facility has a static IP of 10.15.20.180.  So, of course, when I connected the server to our network and ping 10.15.20.180, I get no replies.

ping1Capture

I go to Control Panel > Network and Internet > Network Connections, right-click, Properties, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.

network0Capture

Our network, like most, has a DHCP service.  I’ll need to change to a static IP so that I can add a second IP address to the NIC (multihomed).  I’ll run ipconfig /all to get my current IP.

ipconfig0Capture

Select the Use the following IP address: radio button, retype my static IP information then click Advanced.

network1Capture

Under the IP address section click the Add button and enter an IP address and Subnet mask in the same class as the server I’m trying to connect to – in this case I used 10.15.20.99 and 255.255.255.0.

network2Capture

Click OK to all of that and run ipconfig /all to confirm the additional IP address.

ipconfig1Capture

Now I ping 10.15.20.180 and I get replies.

ping2Capture

And I can remote into the server.