Sunday, May 31, 2015

curl ip address of load balancer

I have an application running on a VM, that sits behind an internal load balancer in Azure. I can reach it locally on /api without any problem.
I have configured the rules for the load balancer to direct traffic coming from port 8001 to 443 on the VM. However, when I try to curl http:///api:8001, it doesn't reach the VM.



How would you curl using a private IP to reach the application that is on the VM?

linux - Should the webserver user have write permission on the uploads/ directory?



I always gave to the webserver user full permissions on these dirs:



cache/

logs/
web/uploads/


But now I am wondering if the uploads part is 0K. I was thinking that maybe it would be better if I use a .tmp file for each upload, and then put them in a queue to be moved to uploads/, and do the same for deletions (the queue will be read and validated by a different user). This way, even if an attacker gets to inject malicious code, the uploads/ folder will be safe.


Answer



Your temporary file idea sounds like a fine idea to me.



Whatever directory the temporary files are uploaded to will need to be writable by the user that your code runs as (typically the webserver, especially when using mod_whatever).




Furthermore, this directory needs to be outside of the DocumentRoot. Whatever anyone uploads there should not be on the internet until it has been vetted. This keeps your server from being used in an email telling me that my logons have been disabled and I need to go to http://example.com/uploads/yourbank.php to fix it.


Windows 7 random freezes

My Desktop Computer with a Windows 7 64bit System freezes randomly an estimated 1-2 times a day, depending on the usage. The moment it freezes, nothing works anymore. I can´t move the mouse, use CTRL-ALT-DEL or anything similar and have to reboot the computer. As I’m doing my work on it, that is unacceptable.



System Specs:





  • AMD FX 4100 Quad Core

  • Motherboard: ASRock Extreme3 R2.0

  • Windows 7 64 bit (fresh install)

  • DirectX 11

  • 8GB RAM (2x Kingston KVR1333D3N9/4G)

  • NVidia GeForce GTX 560 Ti

  • Main Programs installed: SQL Server 2012, Visual Studio 2012, Office 2013, Adobe Acrobat




I´ve been having this problem for over a month now and can´t find the error. What I´ve done up to now:




  • Fresh Windows 7 64bit install

  • Updated BIOS to latest Version

  • Exchanged both RAM-sticks with new DDR3 RAM (2x Micron
    MT8JTF51264AZ-1G6)

  • Changed the BIOS settings for the RAM-sticks to manual, according to
    the settings suggested by motherboard manufacturer

  • Updated the GeForce driver


  • Updated LAN-, USB- and audio-drivers

  • Checked the Windows error-log and found nothing relevant (Event-ID
    41, Category-ID 63 = System rebooted unexpectedly; Event-ID 6008 =
    system was unexpectedly shut down)



I think that was it and I haven’t missed out on anything. My system is still freezing randomly. I bought the computer a year ago and experienced no problems until I reinstalled a fresh copy of Windows 7 on my main partition. All problems have occurred since then.



Have I missed out on anything? I would greatly appreciate any help, as this error is turning out to be very annoying and time consuming.

16 GB WinSxS folder on Windows Vista




I know there are lots of posts about the WinSxS folder, but I have yet to find any useful information about shrinking it. I have already tried running the two service pack removal tools.


The folder totals a massive 16 GB (about 10% of the entire drive!).


If anyone has any pearls of wisdom then please share them.

Does the current Windows 10 media creation tool allow Windows 7 product key activation


Today is the 2nd last day before the Windows 10 Free Upgrade offer expires.
I'd like to know - does the current ISO (or installer) downloaded via the Media Creation Tool (MCT) allow for inputting the Windows 7/8/8.1 product key during the install?


This was possible on the 1511 ISO that was only available for a short time and it meant that a clean install became a one step process for activation. But Microsoft decided to pull the ISO from distribution and only allow the 1511 cumulative update to be applied via Windows Automatic Updates.


Can anyone advise if the ISO available today via the MCT has this ability?


Answer



I have just confirmed that the ISO downloaded with the Media Creation Tool is the now 1511 (build 10586) version of the Windows 10 installer by downloading a new ISO using the tool and checking the details of the boot.wim.


So clean installs will work with a 7/8/8.1 genuine product key without first doing an upgrade install.


enter image description here


hard drive - What are the reasons for HDD failure?


I bought my PC two years ago. One week ago my system failed to boot. I just asked my friends and they said it may have been a virus attack, but two days later I recognized my hard disk was not booting. Luckily, I have a replacement warranty.


Symptoms and Problems



  • While I am playing games, my system automatically goes to a black screen and it makes some noise like "dur dur". It has happened many times.

  • One day my friend borrowed my HDD to test his system. After that, all the problems started.

  • I have the habit sleeping in between watching a movie in my room, so my PC will automatically shut down with out my attention.

  • I have never worried about viruses.


What could have damaged my hard disk? Can a virus kill a hard disk?


I can't claim again for failure, so I'd like to fix this myself.


Answer



None of those things can harm a drive. On one hand, drives do die cause its their time - drive lifetimes usually follow a bell curve - it just happens no matter how carefully you coddle your drive.


On the other hand, if the drive had been mishandled, dropped or had something else nasty happen to it - power surges, or sudden shutdowns, there can be physical damage.


Finally, bad things can happen to data, and different OSes have different modes of failure.


Generally a 'dead' drive won't show up in bios. A slightly dead drive might still have enough life in it to croak out why its dying - though SMART - you can use gsmartctl for a graphical interface to it. If its FS corruption 'only' it should show up in windows or linux - in windows under the disk management snap in, and in linux as a device.


With the first (dead) and second (slightly dead), there's not much you can do. viruses, and software related issues,would, at most,cause the third.


Will this strategy to try Windows 10 work?

A friend wants to try out Windows 10 on a Windows 7 system. But they want the option to go back to exactly how things are now.



Their hard drive is 1TB (platter-based, not SSD), and they don't have a backup device that large.



So here's the plan:




  1. Use Windows 7's integrated Disk Management to reduce the primary partition size to 600GB (the rest is empty space).

  2. Create a Clonezilla live CD.


  3. Use Clonezilla to backup that 600GB partition onto an external USB hard drive.

  4. Switch their system from Windows 7 to Windows 10 using Windows Update.



We have run into the first snag: According to Disk Management, their hard drive has 3 partitions. The first is about 2GB and is listed as "Active, Recovery Partition". That makes sense, as it's likely the recovery partition from the system's manufacturer. The next partition is about 10GB and is listed just as "Primary Partition". The purpose of this partition is unclear; please see this question.



The final partition is listed as "Boot, Page File, Crash Dump, Primary Partition". This is obviously their Windows 7 partition.



Note that they have never installed any OS on their system except Windows 7, which came pre-installed from the manufacturer.




The questions:




  1. Should this plan work?

  2. In order to restore the system, will just having a backup of the last partition using Clonezilla be sufficient, or will there need to be backups of the other partitions as well?

macos - A free utility for NTFS writing on Mac OS X 10.6.5?






Coming from Windows (Vista/7), I have a few NTFS formatted Hard Drives.


Are there any programs to make OS X write to NTFS?


Do I have any options aside from installing Windows via Boot Camp and reformatting?


Answer



Yes. NTFS-3G. You will need to do a bit of hunting to find the free and open source NTFS-3G as opposed to the commercial Tuxera NTFS, which they will quite cheerfully sell you. The latest link at time of writing is on that page under "NTFS-3G for Mac OS X 2010.5.22". I'm not sure if NTFS-3G includes it, but you may also need to install MacFUSE.


Saturday, May 30, 2015

windows 7 - Computer blue screens then restarts unsuccessfully

My computer has always had this problem but lately its gotten a bit more frequent.
While running at seemingly random times the computer goes into a bluescreen and before it has a chance to make any sort of dump it reboots, I don't even get to see the bluescreen for that long, and yes I checked for a MEMORY.dmp in C:\windows (where it's supposed to put dumps) and found nothing, the systems event logs just show a 'general' error which caused a reboot, nothing specific.


After going into the reboot process it hangs in a section where it says it couldn't find a hard drive and that I should insert a hard disk to continue.


If I hit 'restart' on the PC it does the exact same thing giving me the same error about a missing hard drive and I should put one in to boot.


So i have to turn the computer off then back on for it to successfully boot.
The system is Windows 7 with a Core i7 2600K an Asus P8P67 Pro mobo with an Antec 1000W PSU and an nVidia GTX590, it has 4 hard drives, one OCZ 120GB drive, two 2TB Samsung drives and a third 2TB drive but I can't remember the brand (might be Hitachi).


Any ideas?

virtualbox - Vagrant synced folders aren't case sensitive

For our web stack, we are moving from a Windows Server to CentOS. To facilitate development, we're utilizing Vagrant to run CentOS VMs locally. We're using Vagrant's Synced Folders feature to allow devs to use their favorite IDEs on their host machine, but we're finding that one key feature is missing from this setup: file system case sensitivity.



The synced folder inside the VM apparently takes on the properties of the host's file system, so if I'm developing from a Windows machine, or even OSX, the file system isn't case sensitive. This is a big issue, as our production servers will be pure CentOS, and its file system will be case sensitive.



Case sensitivity is one of the main reasons we wanted to have a local VM. We want to prevent "It works on my machine!"



Some workarounds we've considered or tried:




  • Use lsyncd to sync from the vagrant share to a location within the VM that is case sensitive



    • updating files on the host doesn't seem to generate the events in the VM that lsync listens to


  • Make a case-sensitive partition on the host


    • (Doesn't work for Windows)


  • Use samba



    • this may be an option, but we haven't vetted it yet.




Is there a better way? Note that we have developers using Windows, OS X, and Ubuntu, and the solution needs to work everywhere.

laptop - My Asus u56e is randomly rebooting again. Any Ideas?

This seems to be a popular problem for Asus users. However, I have not found a definite cause or solution for the problem.



This machine is roughly four years of age now, and was recently given to me in October of 2014. I had cleared everything off it, performing a clean installation of windows 7 Home Premium, 64 bit edition. A few days later I noticed that it had restarted. At first I didn't think anything of it. But a few hours later, It happened again. I took notice that there was no BSOD. It just did a hard reboot. As if it lost power... Skipping ahead, dealing with the issue for a few months Waiting for replies on a now closed MS thread, I update to windows 8.1 in January. All was well until February 9th. 2015, A bit less than 20 days after the update. Then one on the 20th. Another on the 17th, and THREE today. Latest one over an hour ago (7:29 PM EDT)...




The other two reboots were within half an hour of eachother!!!



Now, Because of the amount of reboots in a single day, I am noticing a slight pattern here. It is most likely to happen under these conditions.




  1. The event has only happened while sitting idle OR Doing something minor such as typing or playing my virtual Keyboard.

  2. Only while connected to a network using the built in Intel WLAN device (Intel Centrino Wireless-N 1030). Ruled out due to the fact it has done this even with network device disabled/disconnected.

  3. Only when the laptop is AWAKE.




I want to know the following




  • Is there anything I can do for a four year old machine that is no longer covered by a warranty, For Free, or really cheap?



    Side note: I am genuinely worried about my hard disk being trashed by the constant rebooting that I may experience. I mean, it is one thing for a random reboot once and a while but TWO within FIVE MINUTES!? You guys can understand why that worries me right? My entire life is on this laptop. If it causes my files to become corrupt, it would be the end of RMSoftware Development as I know it... I need to start backing my stuff up even more so now...




Additional Information:





  • No BSOD means I do not blue screen, thus there are no crash dumps or
    any error reports.


  • As of 3/22/2015: I updated to BIOS Revision 213 via Asus Tech Support. This (Not supprisingly) Did not fix the issue.


  • I Disabled UEFI Booting - No effect


  • I Disabled Intel Anti-Theft (A feature I had no Idea existed on this). No effect.


  • Disabled Asus FancyStart - No effect


  • Uninstalling ATKPackage by ASUS - NO EFFECT.


  • Uninstalling VMWare Workstation - NO EFFECT



  • Updating Intel wireless drivers - Shockingly (genuine shock) NO EFFECT


  • After a crash a few days ago, I removed the battery in frustration. Kept the laptop off for a while, put it all back, and let it run. No problems for now. Thank you @Sharain for that suggestion.


  • Two days of stability now gone: I Was leaving my computer idle while using it as a wireless hotspot. while also connected to a WiFi network (Sharing a VPN connection with my phone) and it restarted. Which again brings me to the question: IS IT MY WIRELESS CARD? IS IT FAILING? (Mentioned above). No I am not always using the hotspot feature, however I am Always connected to some network when it does the shut down. I should note that Lately I notice that when I disconnect from a network, I have to disable and re-enable the card from device manager to get it to reconnect. is this related?


  • two reboots within 5 minutes I was not connected to any network. I went ahead and disabled my wireless adapter following this event. Waiting for any changes...


  • 12 hours nothing.... until now... So I have officially ruled out the wireless adapter. I had disabled it via device manager... shockingly (again legit shock....) it had NO EFFECT. IT IS AT THIS POINT, I AM OUT OF THINGS TO TRY. is this mobo related? Is there a free fix? Is there something I can do?


  • I have been keeping it closed at night and have not had any issues for nearly a week. However I am noticing that my battery no longer warns me if it is low. The main issue now is the battery is a bit under 30 percent when my laptop shuts off. Is my motherboard not getting enough voltage?




Thanks again to everyone who is willing to assist in any way possible, and As always, I hope you enjoy reading my life story of a question.




Latest update: I notice this generally happens during cooler weather. and because I have seen several other users with similar problems (around the same time) and the fact that I have had only one or two crashes the past four months (when it was kind of cool outside). If you guys have any additional theories, feel free to enlighten me. Thank you all for the suggestions thus far.



Special notice: I will continue to update this question as needed, new information will be in bold type.

single sign on - ADFS Metadata with Active Directory Attributes



Using ADFS on Windows 2012 R2. I have created a Relaying Party Trust that has a claim rule defined that maps a Active Directory Attribute to a named attribute in the vendors system.



When I view the federationmetadata.xml file I notice that these attribute are not present, only the items listed in "Claim Descriptions" are present.



Is this normal?
Apparently the Application Vendors system is using PingFederate and they are expecting those attributes to be present in the metadata file.


Answer



Followed advice from Microsoft support and created claim description items which included the attributes I wanted to include, these were then present in the metadata file. Applying an Issuance Transform allowed me to map values to these attributes.



windows 7 - Make a dll color picker default for paint/etc?


I found this color picker DLL file online which is similar to the Photoshop's Color picker.
Normally on other applications including ms paint, the color picker is very old and that's the reason I was looking for a differnt alternative.
Currently I'm using HIDEIT tool to minimize the demo form of the color picker to system tray for opening per requirement time...


The dll site autohr mentions that the dll can be used to be called from other programs, but didn't say anything about how to call it from other programs etc..? I tried installing it in default copy paste way on Notepad++ plugins directory, but that didn't work. Notepad++ said something about ANSI and UTF8 plugins mismatch in an error popup.


My question is: Can I use this dll to be made default for any program calling windows default color picker like paint etc?


Thanks for any help.


Answer



Where the author mentions other programs, he's talking about programs written by you. This DLL is designed to be used by somebody creating a new app that needs a colour picker. You can't easily change an existing binary like Paint to use this instead.


linux - Resizing LVM partition for KVM guest

I've created LVM partition for the KVM guest. The KVM guest is also using LVM partitions itself.




The initial size of the guest's LVM partition was 160GB on the hypervisor. I've extended to 200GB.



I've rebooted the guest and it recognized the new size:



    # fdisk -l

Disk /dev/vda: **214.7 GB**, 214748364800 bytes
16 heads, 63 sectors/track, 416101 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1b11

Device Boot Start End Blocks Id System
/dev/vda1 * 3 1018 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/vda2 1018 332882 167259136 8e Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/vg_main-lv_root: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_main-lv_root doesn't contain a valid partition table

Disk /dev/mapper/vg_main-lv_swap: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_main-lv_swap doesn't contain a valid partition table

Disk /dev/mapper/vg_main-lv_mysql: 158.4 GB, 158385307648 bytes
255 heads, 63 sectors/track, 19255 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_main-lv_mysql doesn't contain a valid partition table


However I'm not able to extend the physical volume to allocate the new space for LVM on the guest machine (/dev/mapper/vg_main-lv_mysql):



# pvresize -v /dev/vda2

Using physical volume(s) on command line
Archiving volume group "vg_main" metadata (seqno 17).
Resizing volume "/dev/vda2" to 334516224 sectors.
No change to size of physical volume /dev/vda2.
Updating physical volume "/dev/vda2"
Creating volume group backup "/etc/lvm/backup/vg_main" (seqno 18).
Physical volume "/dev/vda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resized

networking - Computer wakes by itself, but wake source is unknown


I have an interesting problem. I am using Windows 8.1 on my PC and I have WOL enabled from my BIOS and my LAN card settings and it works just fine.


But, since a couple of weeks back, my computer turns on by itself in the middle of the night.


Two nights ago, after it woke me up because of the noise, I removed the LAN cord and everything was well until the next morning when I powered the PC myself. I also thought it could be a peripheral, so from Device Manager I went through every device there (apart from the LAN card, which I need because of the WOL), disabling Allow device to wake the computer from "Power Management". Also, in the LAN settings, I checked and the network card can be wake the PC up just by using Magic Packet or Pattern Mach.


The problem persisted last night (it woke around 5am).


I started reading forums and saw the idea of looking what last turned on my PC, so I checked with powercfg -lastwake and it returned the following:



Wake History Count - 1
Wake History [0]
Wake Source Count - 0

Because of the answer, I couldn't find a thing, therefore I checked the Windows logs, filtering them by Power Issues. I found the last wake my PC experienced, and the log was as it follows:



The system has returned from a low power state.
Sleep Time: ‎2014‎-‎05‎-‎08T23:38:33.848063300Z
Wake Time: ‎2014‎-‎05‎-‎09T01:56:48.134397800Z
Wake Source: Unknown

This is the reason I have posted the issue here, even though there are many posts about this. I didn't want to repost, but I never found this same problem (with wake source unknown) in any post or forum.


I hope someone has an idea of what may be the problem.


Answer



Disable Windows 8 Automatic Maintenance.


By default, it will wake up your computer around midnight and run some optimization and cleanup tasks.


For reference see What is the "Automatic Maintenance"?


What is the difference between "dnl" and "dnl #" in a sendmail.mc file?



What is the difference between dnl and dnl # in a /etc/mail/sendmail.mc file? If I want to enable something what needs to be in front? Likewise, if I want to "comment out" something, what prefix do I need?




For example:



dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(foo.com)dnl
dnl MASQUERADE_DOMAIN(foo2.lan)dnl

MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl

Answer



There's a subtle but important difference between dnl and # here.



dnl means "delete through newline". When you process your sendmail.mc into a sendmail.cf using m4 (or possibly some frontend), the characters dnl and everything following them, including the next newline, will be dropped. (And all of those lines end with dnl to suppress extra blank lines in the sendmail.cf output.)



Nothing beginning with dnl through end of line will make it out of sendmail.mc and into sendmail.cf.




Anything that remains in the output, of course, will either be sendmail configuration, or a comment that begins with #, which will be copied as-is into sendmail.cf, where they will be ignored.



Anything beginning with # and not deleted above will make it into sendmail.cf unmolested as a comment.



In your example, someone meant for all of the commented features to be removed from sendmail.cf, as well as the comments, since the comments would be meaningless without the features present.


bsod - Windows 7 Bluescreen: IRQ_NOT_LESS_OR_EQUAL | athrxusb.sys

I'd left my system on last night, and found the bluescreen in the morning.
This has been happening occasionally, over the past few days.


Details:



==================================================
Dump File : 022710-18236-01.dmp
Crash Time : 2/27/2010 8:46:44 AM
Bug Check String : DRIVER_IRQL_NOT_LESS_OR_EQUAL
Bug Check Code : 0x000000d1
Parameter 1 : 00000000`00001001
Parameter 2 : 00000000`00000002
Parameter 3 : 00000000`00000000
Parameter 4 : fffff880`06b5c0e1
Caused By Driver : athrxusb.sys
Caused By Address : athrxusb.sys+760e1
File Description :
Product Name :
Company :
File Version :
Processor : x64
Computer Name :
Full Path : C:\Windows\minidump\022710-18236-01.dmp
Processors Count : 2
Major Version : 15
Minor Version : 7600
==================================================

HiJackThis ("[...]" indicates removed text; full log [posted to pastebin][1]):



Logfile of Trend Micro HijackThis v2.0.2
Scan saved at 8:49:15 AM, on 2/27/2010
Platform: Unknown Windows (WinNT 6.01.3504)
MSInternet Explorer: Internet Explorer v8.00 (8.00.7600.16385)
Boot mode: Normal

Running processes:
C:\Windows\DAODx.exe
C:\Program Files (x86)\Asus\EPU\EPU.exe
C:\Program Files\Asus\TurboV\TurboV.exe
C:\Program Files (x86)\PowerISO\PWRISOVM.EXE
C:\Program Files (x86)\OpenOffice.org 3\program\soffice.exe
C:\Program Files (x86)\OpenOffice.org 3\program\soffice.bin
D:\Downloads\HijackThis.exe
C:\Program Files (x86)\uTorrent\uTorrent.exe


R1 - HKCU\Software\Microsoft\Internet Explorer\[...] [...] O2 - BHO: Java(tm) Plug-In 2 SSV Helper - {DBC80044-A445-435b-BC74-9C25C1C588A9}
- C:\Program Files (x86)\Java\jre6\bin\jp2ssv.dll O4 - HKLM\..\Run: [HDAudDeck] C:\Program Files (x86)\VIA\VIAudioi\VDeck\VDeck.exe -r O4
- HKLM\..\Run: [StartCCC] "C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static\CLIStart.exe" MSRun O4 - HKLM\..\Run: [TurboV] "C:\Program Files\Asus\TurboV\TurboV.exe" O4 - HKLM\..\Run: [PWRISOVM.EXE] C:\Program Files (x86)\PowerISO\PWRISOVM.EXE O4 - HKLM\..\Run: [googletalk] C:\Program Files (x86)\Google\Google Talk\googletalk.exe /autostart O4 - HKLM\..\Run: [AdobeCS4ServiceManager] "C:\Program Files (x86)\Common Files\Adobe\CS4ServiceManager\CS4ServiceManager.exe" -launchedbylogin O4 - HKCU\..\Run: [uTorrent] "C:\Program Files (x86)\uTorrent\uTorrent.exe" O4 - HKUS\S-1-5-19\..\Run: [Sidebar] %ProgramFiles%\Windows Sidebar\Sidebar.exe /autoRun (User 'LOCAL SERVICE') O4 - HKUS\S-1-5-19\..\RunOnce: [mctadmin] C:\Windows\System32\mctadmin.exe (User 'LOCAL SERVICE') O4 - HKUS\S-1-5-20\..\Run: [Sidebar] %ProgramFiles%\Windows Sidebar\Sidebar.exe /autoRun (User 'NETWORK SERVICE') O4 - HKUS\S-1-5-20\..\RunOnce: [mctadmin] C:\Windows\System32\mctadmin.exe (User 'NETWORK SERVICE') O4 - Startup: OpenOffice.org 3.1.lnk = C:\Program Files (x86)\OpenOffice.org 3\program\quickstart.exe O13 - Gopher Prefix: O23 - Service: @%SystemRoot%\system32\Alg.exe,-112 (ALG) - Unknown owner - C:\Windows\System32\alg.exe (file missing) O23
- Service: AMD External Events Utility - Unknown owner - C:\Windows\system32\atiesrxx.exe (file missing) O23 - Service: Asus System Control Service (AsSysCtrlService) - Unknown owner - C:\Program Files (x86)\Asus\AsSysCtrlService\1.00.02\AsSysCtrlService.exe O23 - Service: DeviceVM Meta Data Export Service (DvmMDES) - DeviceVM - C:\Asus.SYS\config\DVMExportService.exe O23 - Service: @%SystemRoot%\system32\efssvc.dll,-100 (EFS) - Unknown owner - C:\Windows\System32\lsass.exe (file missing) O23 - Service: ESET HTTP Server (EhttpSrv) - ESET - C:\Program Files\ESET\ESET NOD32 Antivirus\EHttpSrv.exe O23 - Service: ESET Service (ekrn) - ESET - C:\Program Files\ESET\ESET NOD32 Antivirus\x86\ekrn.exe O23 - Service: @%systemroot%\system32\fxsresm.dll,-118 (Fax) - Unknown owner - C:\Windows\system32\fxssvc.exe (file missing) O23 - Service: FLEXnet Licens

Friday, May 29, 2015

apache 2.2 - How to decide on VPS good defaults for PHP and Wordpress when it comes to memory?



I have (only) 512MB to spare. The only thing running on my VPS is PHP/MySQL and on top of it Wordpress. No mail server or any other application, just Wordpress and LAMP stack.



How to decide how much memory to give to PHP and Wordpress? Right now PHP is allowed to have 128MB, how much is safe amount to increase it? I've tried to Google the question but never really found any answers.


Answer



TL;DR - Don't bump your memory limits for the sake of it. For a standard PHP application like WordPress, 128MB is huge and should be enough for 90% of your needs.




However, there are a few important facts here:



PHP Memory Allocation is per-script/process



As per the PHP documentation for the max_memory option:




This sets the maximum amount of memory in bytes that a script is
allowed to allocate. This helps prevent poorly written scripts for
eating up all available memory on a server.





An important distinction to make is that this setting doesn't set the amount of memory that is available to all PHP processes - it sets the maximum available memory for one PHP process.



When Apache receives a request for a PHP page, it forks a PHP process, which dies as soon as its work is done. Any memory used during that request is then released back to the OS and the entire cycle starts again with the next request.



You should never have to tweak the max_memory settings unless you are seeing "Out of memory" errors from PHP itself, and that generally only happens when you:




  1. Are working with large data-sets, which if you're running a WordPress website I extremely doubt.


  2. Have a memory leak or other problem which means that memory isn't being released back to the OS, and the correct response to this type of problem is to investigate the source problem, rather than just bumping limits.



Apache Tuning



If you're interested in tweaking for performance, you should look at the Apache MaxClients and associated options within the prefork module.



I would typically reserve 50MB for the kernel and other system processes, and dice up the rest for Apache and MySQL - there are various online guides detailing how to do this (which I strongly suggest that you read), but the general idea is:





  1. Run top and check how much memory is used by your average Apache process (this is the RES column)

  2. Take your total memory, subtract the amount you want to reserve for other processes, and divide by the number above. This is the number of simultaneous connections that Apache can handle before it will need to turn clients away.

  3. Edit your Apache configuration and set the MaxClients option to this number.



Note I mentioned simultaneous connections above, not visitors on your website. The two are not the same.


Resolving domain names differently for different services



Some time ago we had an issue with our network infrastructure and php with curl.




Our Network infrastructure is fairly simple.



LoadBalancer/Firewall => 5 servers



The Domainname of our website is set to the ip of the Loadbalancer, of course. But calling curl from one of the servers did result in a timeout. It appears that a server could not call for its own domain it is serving. So we had to set the domains via /etc/hosts to the sever itself.



But now We have implemented a Varnish in front of the Loadbalancer, which we want to automatically purge, once a change on a page happens. So now we need to call the domain www.example.com/url_to_purge. Sadly this call what be resolved to the server itself instead of the varnish, because of the /etc/hosts entries.



So now I am wondering, if you could resolve domain names differently for different services :)



Answer



To answer the question, the only way I am aware of - but never seen used - is via the RES_NAMESERVER environment variable.



To answer your problem, I agree with David Schwartz that you need to remove the /etc/hosts entries because it will only cause you problems. Change your approach to either change the firewall or go directly to a backend host.


apache 2.2 - wordpress in subdirectory apache2 without browse index and .htaccess

Sorry if this has been asked before but I looked through other posts and couldn't find my answer.



Wordpress is up and running inside /var/www/wordpress/
However when I browse to www.mysite.com I get a listing of files & folders like the following:



Index of /



Name    Last modified   Size    Description

index.html 12-Mar-2013 18:31 177
wordpress/ 08-Jan-2012 17:01 -


Apache/2.2.22 (Ubuntu) Server at www.mysite.com Port 80



If I click on the wordpress directory, I am brought to my site.



I asked a friend and he said modify .htaccess but there is no file with such name in /var/www/




How do I get apache to set my default homepage/directory to /var/www/wordpress/(index.php) ?



I tried uncommenting
ServerRoot "/var/www/wordpress"



But this led to errors trying to restart apache:
-cannot find ports.conf
-cannot find conf.d
things went downhill from there...




Do I modify sites-available/default?



Do I modify apache.conf?



Do I add an .htaccess file?



Also, since this is a new setup, how do I secure the installation which I read a lot of people use a specially crafted .htaccess file?



Thanks for your help!




Contents of sites-available/wordpress:




ServerAdmin myemail@gmail.com

DocumentRoot /var/www/wordpress/

Options FollowSymLinks
AllowOverride None



Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all


ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn


CustomLog ${APACHE_LOG_DIR}/access.log combined



Contents of sites-available/default:




ServerAdmin myemail@gmail.com


DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all



ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all



ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined




Contents of sites-enabled:



root@ip-0.0.0.0:/etc/apache2/sites-enabled# ll
drwxr-xr-x 2 root root 4096 Mar 20 19:58 ./
drwxr-xr-x 7 root root 4096 Mar 20 19:29 ../
lrwxrwxrwx 1 root root 26 Mar 12 18:31 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 28 Mar 20 19:58 wordpress -> ../sites-available/wordpress

sql server - Memory errors on SQL 2000 with SP4?

I have a SQL 2000 server with a DTS package that is crashing with insufficient memory errors, where we've never had an issue before.



The DTS package is returning the error "There is insufficient system memory to run this query." The SQL error log shows stuff like: (trimmed duplicate lines for simplicity)



BPool::Map: no remappable address found.
Buffer Distribution: Stolen=198908 Free=779 Procedures=349
Inram=0 Dirty=10291 Kept=0

Buffer Counts: Commited=917376 Target=917376 Hashed=717340
InternalReservation=174 ExternalReservation=24
Min Free=1024 Visible= 199856
Procedure Cache: TotalProcs=17 TotalPages=349 InUsePages=340
Dynamic Memory Manager: Stolen=164278 OS Reserved=1048
OS Committed=1026 OS In Use=1024
Query Plan=416 Optimizer=141466
General=16874
Buffer Counts: Commited=917376 Target=917376 Hashed=717340
Utilities=5840 Connection=206

InternalReservation=174 ExternalReservation=24
Min Free=1024 Visible= 199856
Procedure Cache: TotalProcs=17 TotalPages=349 InUsePages=340
Utilities=5840 Connection=206
Global Memory Objects: Resource=1272 Locks=279
SQLCache=52 Replication=2
LockBytes=2 ServerGlobal=23
Xact=35
Query Memory Manager: Grants=1 Waiting=0 Maximum=35238 Available=270



Can someone help me interpret/decipher some of these memory numbers?



This is a dedicated Windows2003 server running SQL2000 Enterprise edition, build 8.00.2282 (SP4). It has a total of 8GB of RAM. The SQL instance is configured with Min Memory = 0, Max Memory = 7167. AWE is enabled.



I've found a ton of articles that seem kinda related:




  • KB 838459 - But we're already on SP4, and this isn't a reindex.

  • KB 815114 - Seems relevant, as our query does have a LOT of tables in the join, more than half of them with a LEFT OUTER, but as I said, we're already on SP4.


  • KB 831999 - Ditto. Already on SP4.



I admit this is a big hairy query, but we've run the identical query for years without trouble, and even if the query isn't really optimal, it shouldn't crash the server, or fail to execute, right?



Any ideas? Should we try the trace flag 3940 mentioned in kb838459, even though the scenario isn't exactly the same?



Yes, we've been encouraging them to upgrade to SQL2008 64-bit, but that's a while off.

Multiple Name Servers on a single IP [Would DNS Root Registry complain?]



Scenario:
I have a single IP, such as 1.1.1.1



I have a nameserver behind it, such as ns1.aaa.com.
I register ns1.aaa.com with my Registrar, and thus the root registry, thus holding my NS responsible for aaa.com domain.




Assume all of the above steps have been done CORRECTLY...



Problem:
What if I want the same host (i.e 1.1.1.1) act as ns1.bbb.com too? Assume that I do everything correctly (i.e my zone file and nameserver config are OK), would the Root registry not complain about the following situation?



ns1.aaa.com points to 1.1.1.1,
ns2.bbb.com points to 1.1.1.1



Is it possible?



Answer



No.



For a more detailed answer than "no", please do research on what glue records are and what role they play in the DNS. There is no central database of what nameservers are authoritative for all domains on the internet (unless you count the root nameservers, which don't work as you're describing), just glue records that are defined on a per-domain basis.


storage - HP ProLiant DL380 G4 RAID conversion?



Proliant DL380-G4 with the onboard SmartArray 6i controller.



Raid 1+0 set consisting of 2x 72 G and 2x 300 G disks (the bigger disks got added later).




Effective capacity about 140 GB and, of course, it is full.



I can't add more disks because the remaining 2 slots are taken by another 2-disk mirror. I can replace the 72 G disks (1 at a time) by 300 G disks and (after rebuilds) grow the array. No redundancy during the disk-swap though. And that 2x :-(



Or I change the array from Raid 1+0 to Raid 5 which will just give me 70 G extra (which is sufficient), but keeps (hopefully) the redundancy intact during the change.



Backup, kill the array, replace the small disks, create new array, then restore is not an option as I need to keep this box online at all times.



I'm not worried about the performance-loss during a rebuild. (User-access to the data is luckily enough quite light in this case.)




I'm looking for recommendations how to get the disk-space quickly upgraded, if possible while maintaining redundancy.



Edit: Changed server-type into G4 (I've got both in the server-room and got them mixed up.)


Answer



The HP ProLiant DL380 G5 has a Smart Array P400i RAID controller and 8 drive slots. The HP ProLiant DL380 G4 has a Smart Array 6i controller and 6 drive slots. I'm trying to understand your arrangement... The process for expansion will be the same, though...




  • You essentially have a 4-disk RAID 1+0 array comprised of 2 x 72GB disks and 2 x 300GB disks.

  • The usable capacity of the Logical Drive in use is ~144GB (equivalent to 4 x 72GB disks in a RAID 1+0 arrangement).


  • I'll assume that two of the original 72GB disks were replaced by 300GB disks.



That makes the easiest path to expansion of the array a simple drive replacement. You will need two 300GB disks. Replace one of the 72GB drives with a 300GB disk and allow the array to rebuild. When that is done, replace the other 72GB disk with a 300GB drive. That will result in a ~600GB usable RAID 1+0 array. I would not be worried about redundancy during the process of the drive expansion. You're only copying 72GB per disk and the rebuild time will be short.



This is covered in detail here: What are the good ways to migrate a RAID array to bigger disks?



Do you have any HP management utilities installed? What is the operating system type and version? Do you have a charged Battery-Backed Write Cache (BBWC) on the controller? That will be needed if you want to do an array transformation or expansion online.



You can convert the RAID 1+0 array into a RAID 5, but since you already have 300GB disks, you should probably complete the job with bigger drives. Plus, why cripple your performance by dropping to RAID 5?




Can you also clarify which server you have?



DL380 G4
enter image description here



DL380 G5
enter image description here


How to determine which process owns a toplevel window?


In Windows XP (and perhaps up to Windows 7) in Task Manager there was a Windows tab where I could right-click an entry for an unidentified message box and then switch to the process which owns that window.


In Windows 10 however, Task Manager has drastically changed. I no longer find anything resembling the Windows tab, so can't seem to do the same procedure I could in Windows XP.


Is the functionality lost? If yes, what stock utility can be used in Windows 10 to determine which process owns a particular toplevel window?


Answer



This is still possible in Windows 10 (explained below), but a more robust version of this ability is available in Microsoft's freely available Process Explorer utility. By "more robust" I mean it can identify the process associated with any visible on-screen element, right down to individual icons displayed in the System Tray. Here's how:


Using Process Explorer



  1. Run Process Explorer (As Admin if the target process is likely to be running outside the current user's security context).

  2. Click and drag the Find Window's Process tool from the toolbar to the window or GUI element in question. The tool looks like this: enter image description here

  3. Process Explorer will highlight in its list the process that owns the window:


enter image description here




The old-fashion way: Windows 10 Task Manager



  1. Start Task Manager.

  2. If necessary, switch to the Detailed view by clicking More details at the bottom.

  3. On the Processes tab right-click an application and click Go to details.
    enter image description here

  4. You'll be taken to the Details tab where the owning process will be highlighted.
    enter image description here


networking - Windows Server 2012 - No communication to other subnets

I have a bit of a weird issue. I have a HyperV server (192.168.0.3) that hosts all my VM's in my network and, up until today, I have had no issues with it.




Now for some reason the PC that is hosting the VM's can not communicate outside of its own subnet....



All other machines on the subnet have no issues, and all the VM's function fine.



There is a central router that handles all my cross subnet routing and internet routing (192.168.*.10 on all subnets). Both the router and the HyperV machine work on the same switch.



My VM's run on both my workstation VLAN/SUBNET (192.168.0.0/24) and on a VM only subnets (192.168.100.0/24 192.168.101/24)



There has been no power or internet loss at the location that hosts the server hardware, the HyperV server simply stopped communicating with anything outside the 192.168.0.0/24 subnet.




A tracert to my RAS server stops at the router (192.168.0.10) and goes no further, all pings to and from any other subnets just time out.



ROUTE PRINT



Network Destination        Netmask          Gateway       Interface  Metric
0.0.0.0 0.0.0.0 192.168.0.10 192.168.0.3 261
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306

192.168.0.0 255.255.255.0 On-link 192.168.0.3 261
192.168.0.3 255.255.255.255 On-link 192.168.0.3 261
192.168.0.255 255.255.255.255 On-link 192.168.0.3 261
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.0.3 261
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.0.3 261

Persistent Routes:
Network Address Netmask Gateway Address Metric

0.0.0.0 0.0.0.0 192.168.0.10 Default


LOGS FROM ROUTER



Mar 16 15:28:08 EXGA-FIREWALL-001 kernel: IPv4: martian source 192.168.0.3 from 0.0.0.0, on dev eth0
Mar 16 15:28:08 EXGA-FIREWALL-001 kernel: ll header: 00000000: 01 00 5e 00 00 01 e0 b9 e5 99 40 5e 08 00 ..^.......@^..

raid - 2x SSD's in RAID1 for MySQL server



I'm in need to upgrade my MySQL machine, as currently I am running 2x SATA 7200rpm drives in RAID0. This of course is quite dangerous incase one of the drives fails.



As I do not need too much storage (all my db's together are about 20 - 25gb), I have been thinking about getting 2 SSD's (80 or 120gb) and putting them in RAID1 setup, so incase one of the SSD's fails, there is a backup present.




Price wise, I can also go for a RAID10 setup with 4x SATA drives. But I think 2 SSD's in RAID1 will still perform better.



For a heavily used MySQL machine, do you think the latest generation SSD's are reliable enough yet? And would this be a recommendable setup?


Answer



That depends on the environment, and the disks you use. You're probably wanting to look at "Enterprise Flash Drives" rather than SSD. I would make the distinction as the longevity difference is significant.



This article discusses viability of EFDs in enterprise environments.
This one discusses longevity of Seagate's "Pulsar" drive. According to Anandt's math, the 200TB version offers about 6 TB of writes before it fails, assuing 4k random read/write over 5 years. The smaller drives add up to less.




You may wish to check the comment string on Chopper 3's post in this question, he has a real world example that may be pertinent to you.



The long and short of it is that it depends on just how write-heavy your environment is. Remember that the wear on SSD/EFD drives is from writes not reads, so if people are just reading from your database, You could conceivably get 2-5 years out of your RAID.



You will get very good performance out of the raid. Switching from spinning disk to SSD has been the single most noticeable performance change in my home PC in the past two years.


hardware failure - How do I diagnose a PC that broke after connecting to a phone via USB 3?


TL;DR


My PC won't turn on after I connected it to my smartphone via USB 3. Something smells burned on my phone's end, but otherwise it appears to be fine. How can I tell what part of my PC is broken?




Forgive me for writing such a long question, but I tried to describe everything that happened with as much detail as possible, so that you can more easily and accurately help me with my problem.


I had recently built a PC, and now it won't turn on.


It all started when my PC was transcoding videos for my phone to play. Since the transcoding process did not use hardware acceleration, my CPU was under almost 100% load then.


After it had finished transcoding a couple of videos, I decided to transfer some of them to my phone. I used a brand new USB 3.1 cable I hadn't used much before (if at all) and plugged it to my PC first, then my phone. Naturally, I used the USB 3 port on my case's front side. I could've used the USB 3.1 port on my mainboard, but I didn't feel like looking around behind my PC.


The phone immediately turned off, followed by a burning smell; there was no sound, though. One of my 2 monitors turned some shade of dark magenta. The monitor in question was hooked directly to my mainboard (thus it must have been running on the Intel HD 580 belonging to my i7 6700K). The other monitor that kept showing me an image was hooked to my GPU instead.


My first concern at that point was my smartphone. The burning smell appeared to come from its USB-C port and it could no longer be turned on. Luckily, after removing the battery and putting it back in, the phone turned on as if everything that happened had been a bad nightmare. However, the nightmare had only begun.


I then turned towards my PC. I found it weird that my second (iGP-powered) monitor was only showing magenta when it should've been showing the current transcoding progress instead. That's when I noticed my (USB) keyboard and mouse wouldn't react at all. Maybe some sort of USB controller had been knocked out? I decided to power off my PC and power it back on.


My PC immediately launched its BIOS setup, something it had never done before, not even after I had finished putting it together. The keyboard still wasn't responding at all. I decided to plug it into a different USB port and reboot the PC. Still nothing. I then decided to plug the mouse in a different USB port instead. More specifically, I plugged it into the same front USB 3 port that I had previously plugged my phone to.


My mouse didn't seem to turn on, but I could hear all the fans on my PC roaring at full speed. It didn't do that with my keyboard in the very same USB port, though. Shortly afterwards, my PC turned off by itself, permanently this time. No matter what I tried, I couldn't get my PC to turn back on.




In an attempt to figure out what exactly broke, I chose to remove the PSU and use it to power my old (pre-built) PC. Everything seemed to work perfectly, so it likely wasn't my PSU. However, that was pretty much the only thing I could test, and now I'm at an impasse.


I'm not sure what caused the problem in the first place. Was it the cable? Was it the port? Or maybe I didn't wire the case's USB 3 port properly to the mainboard, even though I was perfectly capable of using it to install Windows 10 and had been repeatedly using it to recharge a wireless headset? I can pretty much rule out the smartphone, since I had been using it with my old PC before without any troubles.


None of that matters to me right now. What matters is to determine what broke. Luckily, since I had built that PC only 1 or 2 weeks ago, I still have a warranty, and I'd like to avoid having to replace all the components if I only need to replace one of them.


The question is, how can I tell what is broken exactly? Could it be that my CPU fried? Or was it my mainboard? Maybe it's just the case's power switch and USB ports that somehow broke?


Answer



Sounds like ultimately you may need a new motherboard. As for how to diagnose it, a multimeter may help in determining if/how many USB ports simply don't work anymore. If they don't read 5v, they won't work. I suppose it's also possible they are delivering 5v but the data is down (governed by a chip on the motherboard).


Your CPU should be fine but until you swap out of motherboard it will be hard to tell. The iffy/weird graphics could still be related to the motherboard itself.


Windows 8 Professional Download

I have a product key. I am not on Windows. I would love to use http://windows.microsoft.com/en-US/windows-8/upgrade-product-key-only, but it requires me to be on windows. How can I get a non-cracked windows ISO?

Thursday, May 28, 2015

What is the current state (2016) of SSDs in RAID?

There are plenty of resources available online that discuss using SSD drives in RAID configurations - however these mostly date back a few years, and the SSD ecosystem is very fast-moving - right as we're expecting Intel's "Optane" product release later this year which will change everything... again.



I'll preface my question by affirming there is a qualitative difference between consumer-grade SSDs (e.g. Intel 535) and datacenter-grade SSDs (e.g. Intel DC S3700).



My primary concern relates to TRIM support in RAID scenarios. To my understanding, despite it being over 6 years since SSDs were introduced in consumer-grade computers and 4 years since NVMe was commercially available - modern-day RAID controllers still do not support issuing TRIM commands to attached SSDs - with the exception of Intel's RAID controllers in RAID-0 mode.



I'm surprised that TRIM support is not present in RAID-1 mode, given the way drives mirror each other, it seems straightforward. But I digress.




I note that if you want fault-tolerance with disks (both HDD and SSD), you would use them in a RAID configuration - but as the SSDs would be without TRIM it means they would suffer Write-Amplification which results in extra wear, which in turn would cause SSDs to fail prematurely - this is an unfortunate irony: a system designed to protect against drive failure might end-up directly resulting in it.



So:




  1. Is TRIM support necessary for modern (2015-2016 era) SSDs?



    1.1. Is there any difference in the need for TRIM support between SATA, SATA-Express, and NVMe-based SSDs?


  2. Often drives are advertised as having improved built-in garbage-collection; does that obviate the need for TRIM? How does their GC process work in RAID environments?




    1.1. For example, see this QA from 2010 which describes pretty-bad performance degradation due to not-TRIMming ( https://superuser.com/questions/188985/how-badly-do-ssds-degrade-without-trim ) - and this article from 2015 makes the case that using TRIM is strongly recommended ( http://arstechnica.com/gadgets/2015/04/ask-ars-my-ssd-does-garbage-collection-so-i-dont-need-trim-right/ ). What is your response to these strong arguments for the necessity of TRIM?


  3. A lot of articles and discussion from earlier years concerns SLC vs MLC flash and that SLC is preferable, due to its much longer lifespan - however it seems all SSDs today (regardless of where they sit on the Consumer-to-Enterprise spectrum) are MLC thesedays - is this distinction of relevance anymore?



    1.1 And what about TLC flash?


  4. Enterprise SSDs tend to have have much higher endurance / write-limits (often measured in how many times you can completely overwrite the drive in a day, throughout a drive's expected 5 year lifespan) - if their write-cycle limit is very high (e.g. 100 complete writes per day) does this mean that they don't need TRIM at all because those limits are so high, or - the opposite - are those limits only attainable by using TRIM?


network shares - Virtualbox - folder does not automatically mount, Windows 7 host Ubuntu 17.10 guest

I'm trying to use Virtualbox's shared folder functionality, and I can't get the automount folder feature to work.


I've followed directions in various SO/AskUbuntu questions, and it seems like I set up shared folders correctly.


More details:


Mounting the folder with sudo mount -t vboxsf vbox_shared /media/vbox_shared works, including write access.


I've installed Virtualbox Guest Additions, and lsmod | grep vboxguest returns vboxguest 294912 2 vboxsf,vboxvideo.


I've run sudo usermod -G vboxsf -a to add myself to the group.


I've restarted the virtual machine.


In Virtualbox settings, I've set Folder Path: C:\Users\\vbox_shared, Folder Name: vbox_shared, Auto-mount and Make Permanent are checked.


Host is Windows 7 Enterprise, Guest is Ubuntu Server 17.10, Virtualbox 5.2.6.


What else could be the cause of this?

performance - Real time monitoring of MS Windows servers and their services



We have a bunch of large HDTVs in our monitoring office keeping an eye on all of our production equipment.



We are monitoring:



Cisco routers





  • HP switches

  • HP proliant servers

  • Windows 2003

  • IIS

  • SQL server



At the moment we use




  • Nagios for uptime/availability and alert sending

  • Cacti for bandwidth usage

  • Perfmon running on Vista for server performance

  • A combination of other tools and our own custom code to monitor our actual application performance.



All of this is fine apart from the Perfmon part - it gives us what we want - i.e. real time charts on the screen, logging certain performance counters, etc - the only problem is setting it up is a real chore. If the Vista PC running Perfmon is rebooted (normally due to Windows Update) then setting all the counters up again takes ages - literally an hour or two's worth of work for somebody in the office...



Anybody know of a way to either:
1. Script adding Perfmon counters

2. Another tool with graphical output and WMI/windows counter access.



Thanks




Answer



I would seperate out the charting/display from the montioring/alerting piece. You haven't said how many object you have. For most shops I'd write a powershell script to get the counters I want and pipe the output to powergadgets and for small shops use polymon to monitor the windows stuff and groundwork to monitor the rest. In a larger environment (30+ servers) I'd take a look at System Center Operations Manager for monitoring and alerting. You have to realize howver that SCOM is NOT just monitoring. It's designed to correct problems and ensure business service, unlike most monitoring software that only cares about server counters. Other options would be tivoli or openview.


Git Daemon on linux?



Trying to set up a simple git-daemon on a linux server, and talk to it from a windows box.



On linux server:





  1. Make a folder /home/foo/bar

  2. CD to /home/foo/bar

  3. do a git --bare init here

  4. Do a touch git-daemon-export-ok

  5. CD to /home/foo

  6. Run the command git-daemon --verbose --reuseaddr --base-path=/home/foo --enable=receive-pack



On Windows Client w tortoise Git





  1. Do git.exe clone --progress -v "git://servername/bar" "C:\source\myFolderName" (works)

  2. Create file a.txt, add it to git, and commit (works)

  3. Do a git.exe pull "origin" master and then get fatal: Couldn't find remote ref master (makes sense, master isn't there yet)

  4. Do a git.exe push "origin" master:master and tortoise hangs forever without do anything



I realize why I can't pull from master yet on the remote branch.. but why can't I push my first commit into the remote repo? #4 really should work. Tried it both with tortoise and the mysysgit command line, both cases I hang forever. What am I missing? Server has no useful log


Answer




Unfortunately this is probably a bug in msysgit http://code.google.com/p/msysgit/issues/detail?id=457



As of right now there is a workaround (not in the main branch I think) but no true fix.


memory - How can I enable PAE on Windows 7 (32-bit) to support more than 3.5 GB of RAM?

I know that Windows XP 32-bit can be configured, through PAE, to support more than 3.5 GB of RAM. Is there a good tutorial to do this with Windows 7 32-bit?


As to why I don't simply use 64-bit Windows 7: The software for my Internet connection (cell phone-as-modem) will only work in 32-bit environments.

macos - How do you create a bootable partition on a USB drive?

I have a bootable ISO designed to be burned to a double-layer DVD. I don't have a double layer DVD burner, so I would like to stick the ISO image on a 50 GB partition on a USB hard drive I have. How do I get the boot info onto the hard drive?


Attempt 1:



  1. booted into Ubuntu 9.04 LiveCD

  2. deleted the partition on my existing USB hard drive

  3. sudo dd if=/path/to/image.iso of=/dev/MyUSB

  4. booted to USB drive

  5. error: Error Loading OS


Atempt 2:



  1. booted into Ubuntu 9.04 LiveCD

  2. deleted the partition on my existing USB hard drive

  3. sudo mkdosfs -I -v -n iPC /dev/MyUSB

  4. sudo syslinux /dev/MyUSB

  5. sudo dd if=/path/to/image.iso of=/dev/MyUSB

  6. booted to USB drive

  7. error: Selected boot device not available - strike F1 to retry boot, F2 for setup utility

windows 8 - How to recover from PATH being truncated to 1024 characters by SETX

I received an error on Windows 8 after trying to use SETX to add JAVA.exe to the Windows PATH variable:


WARNING: The data being saved is truncated to 1024 characters.

After a reboot, I notice that the PATH is indeed much shorter than before. I've since read that SETX can't handle more than 1024 characters. That would have been good to know in the article which recommended using it.


I am wondering if my system will be unstable now that (presumably) some of the directories no longer appear in the PATH variable. The end of the string is clearly cut off mid-directory (at Pr):


(...) ;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Pr

Is there any way to roll back or anywhere that the previous value of PATH was captured. Man, I can't believe this kind of stuff can still happen in Windows after 29 years.

laptop - Keyboard typing random forward slashes by itself



I just bought a ACER ASPIRE V3-572G laptop that came with a preinstalled Windows 8.1, booted it up, set up the OS, installed virtually nothing and then started getting some Windows updates. Got a bunch of them, then some bigger one (~770MB - KB3000850) started failing because something was locking up the files.


I deleted the McAfee LiveSafe that came with it and it installed the update just fine. Restarted the thing and weird stuff started happening, couldnt enter my password because some characters were being automatically typed into the text box, finally got in, system was behaving kinda weird, sort of being interrupted and when typing into browser address bar I noticed that forward slashes are being typed by themselves, opened up a text editor and so it was. '////////' everywhere. Thats the story.


I am pretty sure the key is not stuck, I barely touched the keyboard and it was in my line of sight all the time so nothing was spilled or anything, plus the forward slashes come at random, sometimes not at all, sometimes its like ticks, sometimes as if the key was pressed down.
Should I start rolling back windows updates, cause I did some typing during the setup phase and didnt have this type of problem. Any way to track down what is causing it? Don`t really want to factory reset and then have the same thing all over again.
Any help will be greatly appreciated.


Answer



This does not sound like a problem you want to mess with. Just exchange it for one that works before warranty is up.


security - Disk wiping other than DBAN



Sometimes using DBAN takes several days to wipe a disk. What alternatives do you have experience with that work within a few hours and offer the simplicity of DBAN? I am mainly interested in free solutions but am happy to hear what works for you.


Answer



Edit: Based on your more recent comments, it sounds like you're probably running into hardware variations that cause DBAN to run slower (on older hardware) or faster (on newer hardware). Any other program that performs a thorough disk wipe will probably be similarly slow when wiping a hard drive that's either very large or connected via a slower interface. Of course, wiping a small drive over a slower interface (e.g., 80 GB IDE) may still be faster than wiping a much larger drive on a faster interface (e.g., 1 TB SATA).




It depends on how paranoid you are. Generally, the extremely long-running disk wiping utilities do an extremely thorough job wiping the drives clean so there's virtually zero chance even the most advanced data recovery techniques would be able to use any residual magnetism to reconstruct the old data.



If you are giving away the drives and they contained any sensitive information whatsoever, you're better off safe than sorry--go with a more thorough wipe over the course of days. If there really isn't anything sensitive on the drives, or if you're just taking them out of service for reuse later, you're probably safe using a faster, less thorough wipe.



Personally, I usually boot off a Linux live CD and use one of the following:



dd bs=1M if=/dev/zero of=/dev/sd#


or




dd bs=1M if=/dev/urandom of=/dev/sd#


or



badblocks -wvs /dev/sd#


where /dev/sd# is the drive I'm wiping.




I didn't think it was sufficient to just write zeroes to the drive until a friend showed me The Great Zero Challenge. While there's no guarantee that writing zeroes to the drive is actually sufficient, it must be difficult enough that data recovery firms did not want to risk the negative PR associated with being unable to recover any data from the drive after it was zeroed.



If you write random data to the drive, the argument is that the random data should make recovery more difficult (similar to salting a password hash).



The badblocks -wvs command will run four wipes on the drive, writing the patterns 0xaa, 0x55, 0xff, and 0x00 across the entire disk, respectively. It also (somewhat unnecessarily) performs a read test after each full write, but if you end up finding bad blocks, you might as well just trash or recycle the drives and drill holes through the platters for maximum security.


Can Windows-7 Home Premium 32bit retail full install be used with a Window-7 Home Premium 32bit Upgrade license key?


Can Windows 7 Home Premium 32bit retail full install be used with Windows 7 Home Premium 32bit Upgrade license key?


I bought a Windows-7 32 or 64bit Home Premium Upgrade DVD (upgrade from Vista). I complete the installation upgrade of Windows-7 32 bit Home Premium doing the following:



  1. Install Windows 32bit Vista Basic DVD.

  2. Use Vista serial product license key/COA

  3. Install Windows 7 Home Premium Upgrade (using the 32bit DVD, not the 64bit edition DVD, can only use one or the other)

  4. Install of Windows 7 Home Premium checks for Vista already present and then once found OK offers the option of complete clean install, i.e. wiping the drive first.

  5. Use Windows 7 Home Premium License product serial number license key/COA

  6. All OK - valid install upgrade path


But, if I ever need to do this again, for quickness, I'd rather just use a full retail (non-OEM) Windows Home Premium 32bit install DVD from scratch and type in the Windows 7 Home Premium License product serial number license key/COA. Can I do this?


Done some searching already but the results are mixed up with OEM installs so not clear if I can or not, e.g.:


This one is closest, but does it apply to my specific question too:


Answer



I just went through this last night on a fresh hard drive, and Windows 7 won't let you install an Upgrade version unless it detects a valid previous Windows install. There's a "workaround" for this by simply installing Windows 7 once (don't enter a product key when prompted), reboot, and then re-install again over the existing install, this time entering the product key. This avoids the "invalid product key" error you'd otherwise get from the first install on a clean drive.


partitioning - How to recover Windows 7 partition?


I created a 50GB partition on my hard drive to experiment with installing a 2nd copy of W7. (I wanted to see if a clean install would fix a bug)


However, It seems I can no longer access the old part of my computer the way it was before. I was under the impression that creating a partition like this was harmless. Is there anyway to change my primary partition back to what the computer boots to?


Thanks


Answer



Usually if you don't explicit delete a partition it will be able to backup, because partition table is mostly changed.


If you have a computer with a working Windows or Linux system you can create a bootable CD with a very good and free partitioning software called Easeus Partition Master (Home Edition):


Just follow the instructions here:


http://www.partition-tool.com/easeus-partition-manager/bootablecd.htm#I2


If you have no working computer, you must download from somewhere a Boot-CD, like one of the best i know is Hiren's Boot CD which has a lot of tools on it for partition and MBR-Recovery:


You can find it her: http://www.hiren.info/pages/bootcd


How do I interpret the specification of memory (RAM)?


When looking at memory there are a few specifications that I don't understand and was hoping to have clarification on. What do these terms mean, and how do they affect the systems performance? Feel free to give technical data and answers to these, but not specific to the specs that I list as example below.



  • Speed: DDR3 1600, DDR2 800

  • Timing: 9-9-9-24 (what do each of the numbers mean?)

  • Voltage: 1.5V (I know what voltage is, but how does it affect my system?)

  • Multi-Channel Kit: Dual, Quad


Answer



Speed


The numbers are in MHz, and represent the frequency of the clock signal at which the RAM operates (x2 for DDR RAM, so DDR2-800 is running at 400MHz). The DDR means "Double Data Rate" which means it transfers data on both the rising AND falling edges of the signal (instead of just signal on vs. off). So, for example, DDR gives you the effect of 800MHz while actually still only being at 400MHz. DDR2 and DDR3 are superseding versions of the DDR spec. (ie: DDR3 is "double data rate type three").


Timing


Memory timings (or RAM timings) refer collectively to a set of four numerical parameters called CL, tRCD, tRP, and tRAS, commonly represented as a series of four numbers separated with dashes, in that respective order (e.g. 5-5-5-15). However, it is not unusual for tRAS to be omitted, or for a fifth value, the Command rate, to be added on (from Wikipedia).


CL (CAS Latency)


The CAS latency is the delay, in clock cycles, between sending a READ command and the moment the first piece of data is available on the outputs.


LRCD


Row Address to Column Address Delay - tRCD is the number of clock cycles taken between the issuing of the active command and the read/write command. In this time the internal row signal settles enough for the charge sensor to amplify it.


tRP


Row Pre-charge Time - tRP is the number of clock cycles taken between the issuing of the pre-charge command and the active command. In this time the sense amps charge and the bank is activated.


tRAS


Row Active Time - tRAS is the number of clock cycles taken between a bank active command and issuing the pre-charge command.


See here for more info on these and other RAM timing elements.


Voltage


The listed voltage is the minimum/recommended voltage required to power the RAM module. Not enough and it can't power the module, too much and you can damage the various chips on the module.


Multi-Channel Kits


These 'kits' are simply multiple single, similar (identical as possible) RAM modules packaged together. The intention (these days) is for them to be used in motherboards that have dual and triple (etc.) RAM channel capabilities. IE: since you need 2 sticks to do dual channel, and that became standard/regular for new systems a while back (before triple channel, quad, etc.), the memory manufactures started marketing their existing 'kits' as 'multi-channel kits'.


Previously the kits were sold mainly to give a bit of a break on price when buying multiple modules (ie: Two 1GB modules in a '2GB kit' is cheaper than buying two individual 1GB modules of the same model).


Wednesday, May 27, 2015

windows - find out which computer has opened a file on Servers network share

I have a Windows Server 2008 and it shares a folder. Many clients access that folder and the inherit files. One client opens one dll file
sporadically with mode rw, so after that no other client can load the dll.


Now I want to determine which client does it. All tools I found:



  • openfile

  • net

  • sharewatch

  • NetShareMonitor


doesn't show me the Network client which opens the file in rw mode.


I think it is the antivirus programm, but I need to know which client has the file opend.


Edit:



  • The clients are windows machines

  • All clients use the same user, so I can't determine the client with the username

active directory - Secondary domain controller not functioning when primary domain controller is not reachable

We are small business intelligence company and we have a head office and a branch office. I have active directory running on windows 2012 R2 in the head office and another active directory running on windows 2012 in brnach office. Both offices are connected via site to site VPN.



When ever there is connectivity issues between two office or the PDC is down, the seconday AD server goes down as well. It is not configured as a RODC. when I try to check the domain settings under domains and trusts, I get the error





You cannot modify domain or trust information because a Primary Domain Controller (PDC) emulator cannot be contacted. Please verify that the PDC emulator for the current domain and the network are both online and functioning properly.




Users are unable to authenticate and when I try to access users and computers I get the following error below.




Naming information cannot be located because:
The specified doamin either does not exist or could not be contacted.
Contact your system administrator to verify that your doamin is properly configured and is currently online.





I see both the Domain Controllers are set as GC Servers. I am not an expert in active directory. I am hoping it is a minor issue some one should be able to help me fix it.

Configure IPTABLES to MASQUERADE traffic from a single host in lan and block other

Have a proxy server with squid installed. Want to configure iptables so as to allow a single ip in lan to access internet directly without directing the traffic through squid.
the following works to masquerade traffic but how to filter so that only one ip is given access
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE



the current iptables configuration is default. It does't have any rules applied.The squid server does its usual of providing proxy internet service.



currently i am studying iptables, so not a expert in it.So kindly be specific to rules that should be applied.

wordpress - Trouble directing A name and subdomain to different hosts



I am hosting a domain on namecheap with namecheap's DNS service.




I want to point digest.politihacks.com to politihacks.wordpress.com with a CNAME record. This works fine.



However, I also want to point the top level name politihacks.com to github's static page hosting service at 204.232.175.78. When I add the A record for this, it works as expected BUT the previous CNAME now also redirects to github instead of wordpress.



In my terminal I typed dig digest.politihacks.com and it looks like it SHOULD point to wordpress:



 ; <<>> DiG 9.7.6-P1 <<>> digest.politihacks.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39614

;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;digest.politihacks.com. IN A

;; ANSWER SECTION:
digest.politihacks.com. 77 IN CNAME politihacks.wordpress.com.
politihacks.wordpress.com. 3533 IN CNAME lb.wordpress.com.
lb.wordpress.com. 17 IN A 66.155.9.238
lb.wordpress.com. 17 IN A 76.74.254.120

lb.wordpress.com. 17 IN A 72.233.2.58
lb.wordpress.com. 17 IN A 72.233.69.6
lb.wordpress.com. 17 IN A 76.74.254.123
lb.wordpress.com. 17 IN A 66.155.11.238

;; Query time: 43 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Feb 28 02:02:18 2013
;; MSG SIZE rcvd: 189



But as I mentioned, visiting digest.politihacks.com in my browser redirects to my github static page. What could be wrong?



Thanks!


Answer



This is not a DNS problem (although there is one problem: I get "... has no A record" instead of 204.232.175.78).



What you observe with digest is caused by a http redirect (301 Moved permanently).


domain name system - Fail over to DNS provider

****Dns Server that is stand alone backup to dns service with DNS provider.****




We recently had our primary dns service provider go off line and our clients could not get to our web servers. It is possible to create an Windows Server 2008 DNS server and have it setting here off line and outside of our local domain and LAN to act as fail over?



In the event that this same situations happens , in theory, Could I plug it in and tell our registrar the new IP address? I realize that there would be no real time sync on the local external dns server here.



Would that work?



Thanks

linux - Crontab /etc/profile.d



I have a crontab script which runs fine from the interactive shell.
However when running from crontab it fails because it doesnt run the scripts in /etc/profile.d/ (e.g. /etc/profile.d/java.sh)




Whats the best way of fixing this?


Answer



begin the shell script with:



#!/bin/bash -l


This causes bash to start as a login shell, which means it will read /etc/profile and ~/.bash_profile.


windows - How to batch copy & rename files?


I'm using windows server 2012 R2. I have a folder with a bunch of files and I want to copy for every file in that folder 20 times into another folder but the newly copied file has to be renamed using single alphabetical orders. For example a file called "orange.html" gets copied 20 times and moved to another folder. The new folder would contain 20 new copied files with file names such as a.html, b.html, c.html etc.


This is the code but all it does increment by numbers but I want to increment by the alphabet


@echo off
for /L %%i IN (1,1,100) do call :docopy %%i
goto end
:docopy
set FN=00%1
set FN=%FN:~-3%
copy source-file.html poll%FN%.html
:end

Answer



All it does increment by numbers but I want to increment by the alphabet


The following batch file (test.cmd) should get you started:


@echo off
setlocal enableDelayedExpansion
set "chars=abcedefhijklmnopqrstuvwxyz"
for /l %%i in (0,1,25) do (
echo copy source-file.html folder\poll!chars:~%%i,1!.html
)
endlocal

Notes:



  • This is a partial answer because your requirements are not clear.

  • Use the above batch file as a starting point

  • It shows how to construct the file names using incremental letters of the alphabet.


Example output:


copy source-file.html folder\polla.html
copy source-file.html folder\pollb.html
copy source-file.html folder\pollc.html
copy source-file.html folder\polle.html
copy source-file.html folder\polld.html
copy source-file.html folder\polle.html
copy source-file.html folder\pollf.html
copy source-file.html folder\pollh.html
copy source-file.html folder\polli.html
copy source-file.html folder\pollj.html
copy source-file.html folder\pollk.html
copy source-file.html folder\polll.html
copy source-file.html folder\pollm.html
copy source-file.html folder\polln.html
copy source-file.html folder\pollo.html
copy source-file.html folder\pollp.html
copy source-file.html folder\pollq.html
copy source-file.html folder\pollr.html
copy source-file.html folder\polls.html
copy source-file.html folder\pollt.html
copy source-file.html folder\pollu.html
copy source-file.html folder\pollv.html
copy source-file.html folder\pollw.html
copy source-file.html folder\pollx.html
copy source-file.html folder\polly.html
copy source-file.html folder\pollz.html



Further Reading



  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.

  • enabledelayedexpansion - Delayed Expansion will cause variables to be expanded at execution time rather than at parse time.

  • for /l - Conditionally perform a command for a range of numbers.

  • set - Display, set, or remove CMD environment variables. Changes made with SET will remain only for the duration of the current CMD session.

  • variables - Extract part of a variable (substring).


windows - Disable UpdateOrchestrator Reboot task


About a week ago my Windows 10 Pro started waking up in a middle of the night. I've had similar problems about half a year ago, but managed to configure the cause - unruly UpdateOrchestration task and disable it - using this answer. Disabling the "Wake the computer..." option in Reboot task helped.


However, about a week ago the computer started waking in the middle of the night again and I am unable to convince the Reboot to stay down this time. When I uncheck "Wake the computer..." option a window appears that asks me to provide login credentials for some mysterious S-1-5-18 user that I have never heard about (see the picture below, I use the Polish Windows version).


enter image description here


I have no idea what the password for S-1-5-18 should be. This window's dropdown allows me to choose other users though, besides the mysterious S-1-5-18 - in fact there seems to be about 5 accounts with names similar to my Windows username (why there is a multitude of them? I have no idea, Control Panel shows me as the only user of this computer); when I select one of them in the dropdown and enter my password I get the following message (translated from Polish to English):



The supplied variant structure contains invalid data



Do you have any idea how to disable the computer from rebooting at night?


--


EDIT: To clarify the multiple username thing: there is a single S-1-5-18 user in the dropdown. The multiple user thing I said pertains to my original Windows username. The following picture shows the content of the users dropdown. I have edited out the names that show my original email address, my real name or the names of my computers.enter image description here.


EDIT2: I tried disabling the "Wake to run" option on the task using PowerShell, with the following script and it also did not work. No error is given but the WakeToRun stays true.


 ?{ $_.Settings.WakeToRun -eq $true -and $_.State -ne 'Disabled' } |
%{
write-host $_
$_.Settings.WakeToRun = $false;
Set-ScheduledTask $_
}

Answer



I was eventually able to disable the Reboot task. Firstly, I tried the following line in cmd:


SCHTASKS /Change /TN "Microsoft\Windows\UpdateOrchestrator\Reboot" /DISABLE

It did not work, and the error message said I do not have sufficient privileges to modify the task (even though I work on a Windows admin account). However, thanks to this message, I was able to find information about NSudo program. Per the already linked hint, I used it in a TrustedInstaller mode to start cmd and - lo and behold - SCHTASKS now worked perfectly, allowing me to disable the Reboot task. Windows is user friendly, they said.


EDIT: To make things clearer, NSudo gives you privilages over Reboot task and you do not have to use exactly the cmd listed above to disable Reboot task. Alternatively you may, for example, use it to run taskschd.msc and edit the Reboot task to your liking in the window that opens (for example by unchecking the "Wake up..." checkbox).


I have found that the changes don't always stick. The aforementioned message states that on has to issue the following command using cmd from NSudo (note you may have to translate the account names to language your Windows uses):


icacls "%WINDIR%\System32\Tasks\Microsoft\Windows\UpdateOrchestrator\Reboot" /inheritance:r /deny "Everyone:F" /deny "SYSTEM:F" /deny "Local Service:F" /deny "Administrators:F"

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...