Tuesday, March 31, 2015

windows server 2008 - Using a RAID 0 partition for a swap file



I am configuring RAID arrays for a HP Proliant server running Windows Server 2008. We will probably use RAID10 configurations, but split it to several logical drives.



Is it reasonable to create a single dedicated RAID 0 logical drive just for the swap file?



[Edit]




Here is our system info:




  • HP Proliant ML350 G6

  • 1x Intel Xeon E5520 4 core

  • 6GB RAM PC3 UDIMM

  • P410i HW RAID controller + 512MB BBWC

  • 4x 1.5Tb SATA

  • Windows Server 2008 R2 Enterprise




[Edit2]



Ok, at the end I realized I was talking nonsense.



Since I was planning to use RAID10 for these 4 disks anyway (write speed 2x, read speed 4x), I realized it didn't seem too justified to make a small RAID0 partition for the relatively small benefit I get (write 4x, read 4x) compared to the mess I would end up with if one of my disks would die.



My idea was something like this:





  • RAID array: 4x1.5Tb.


    • 1st logical disk: 4x16Gb RAID0 for swap

    • 2nd logical disk: 4x1.3Tb RAID10 for everything else




Once you create an Array out of these 4 physical disks, HP P410i allows creating several RAID setups which can utilize them partially.




Never mind, I will simply use RAID10 and have a reasonably fast, but much safer machine.



[Update a couple of years later]



Found this question from long ago and decided to update, in case someone has a similar dilemma: at the end we simply went with RAID10 and upgraded our RAM to 32GB. With RAM prices these days, you simply shouldn't allow the server to touch the page file. Also, if you want a blazingly fast response, using a couple of enterprise SSDs is also not such a big expense like it used to be.



One additional conclusion we got is that, if you need more storage, than it actually might make sense to use smaller SSDs in your server and use a SAN for actual data storage. At some point, server storage capacity will reach its expansion limits, so it's better to keep this in mind and design your system for scalability.


Answer



No. It is reasonable to avoid swapping.




If your system swaps, the performance increase from Raid 0 will be negligible compared to the performance loss from swapping. Besides, how big do you want to make the swapfile?



Raid 0 increases the chance of failure, so you make your system less reliable by setting this swap scheme up.



If you know you must swap regularly, you might think about SSDs. But then thats a write cycle that is suboptimal for the current lines of SSDs. YMMV.



Please post more information on system setup and useage (ram size? file? db?)



Old hint: make the pagefile fixed size and big. This avoids fragmentation of the swapfile. (not sure if this is still true for 2k8)


windows 7 - Why is the folder size (in properties) different from the total file/folder sizes in the folder?


Here's my problem


I'm trying to do a cleanup of my hard drive, and I'm constantly seeing this scenario:


(1) Aggregate folder size: I check the folder size viewing properties right clicking the folder


(2) Individual folder/file sizes: I check the individual file/folder sizes belonging to that folder viewing properties on the individual file/folder sizes, and then adding them up (with hidden and system files shown).


These two figures are always different, sometimes by a large margin.


For instance, my C drive now, by method (1), shows a consumed space of 42.4 GB.


However, by method (2), by inspecting the respective files/folders, the total consumed space adds up only to 33.1 GB. This is a 28% discrepancy (over the smaller file size) and I have no idea where the rest of the space is going.


My hard drive is constantly in danger of being full (it's bootcamp on a mac with 50 GB of partitioned space), and there's not much I've got installed in terms of software, nor do I have large media files like movies, downloads, temp files, application temp files, torrents, etc.


Most of it's just consumed by the files in C:/Windows, but last I checked, I don't know enough to know which files to delete, and I've heard that you really can't do anything about the space boggling winsxs and system32.


Can you guys recommend a starting point to free up disk space?


Thanks!!


Baggio.


Answer



When you open Explorer and select properties, Windows reads the free space from the NTFS bitmap metafile. Selecting all files/folders in explorer and showing properties, scan all files/folders. But Windows skips here hidden files/folders and folders where your current user doesn't have read permissions (System Volume Information folder for example).


You should use TreeSizeFree (run it as admin) to see which folders take most space:


enter image description here


Gnome change virtual desktops by moving mouse to edge of the screen

I remember with older window managers you could switch virtual desktops by moving the mouse to the edge of the screen and your virtual desktop would change.




So if you have two virtual desktops left and right, if you move the mouse to an edge your virtual desktop would switch to that one.



Is this feature in gnome or do you need to use keyboard shortcuts and the virtual desktop widget in the panel.

lamp - The best way to learning Linux/Apache server administration




What is the best way to start learning Linux/Apache server administration?

I am a web developer using LAMP platform.


Answer



Install a linux distro on a real box or a VM and start administering.



I'd either go with Redhat/Centos/Fedora if you want a Redhat based solution or pure Debian (as opposed to say Ubuntu) if you want a Debian based solutions.
I believe these are the most common server distros, so are probably the ones to learn on.
Make sure you install the apache documentation package regardsless of which distro you go with.



The apache site httpd.apache.org has a lot of good docco and recipes for common scenarios, e.g. https, name based virtual hosts etc.




Then start installing your php apps and running them.



I suggest that you use revisions control for your config files(I prefer RCS for config files as is is always available no matter what state the box is in regards networking).
This makes it really easy to prevent if a change does not do quite what you hoped and gives you an easy way to recall your changes, what you have tired etc.



I'd also suggest you join appropriate mailing lists. I'm not sure what lists apache has, but most projects have something like a user list and an announce or security list. For linux I'd find a local user group and join their mailing list.
The idea here is that you will see what other people are doing and how they approach stuff, thereby get an idea of what the capabilities are, and of course you'll be able to ask specific questions when you have problems.



This gives you a forum where you can ask general questions and ususally get replies reasonably quickly.




Also make use of IRC when you have questions.



Whenever people ask about learning linux I give this as part of my answer:
Read the man pages.
As many of them as possible.
I suggest you list /sbin/ /bin /usr/sbin and /usr/bin and read the man page for each command.
You don;t have to learn it by heart but by going through the binary directories you get a chance to see what commands are available - some of them you won't be able to guess what they do, but other you'll probably be able to guess what they do, which helps you understand what commands are available on the box.
By reading or at least skimming the man pages for those commands you will at least have a vague idea on what they do.
Then when you say " I want to add another IP so I can use SSL on a second VirtualServer" you'll know there is a command called ifconfig and it had something to do with configuring networks interfaces.




For books I'd suggest either Linux or unix in a nutshell as the linux/unix ref.
I don't have a specific apache ref, I pretty much taught myself what I know about apache using the above techniques.


usb - Do I need Windows AIK to integrate a winqual driver into install.wim?

I have windows7 ultimate 64bit installed on my pc. I have the bootable usb setup files for windows 7 ultimate 64bit. I want to integrate some WinQUal drivers into the setup files.


Can I do this with Dism alone or do I need to download Windows AIK for it.


All I need is to integrate few winqual drivers specific to my pc into the installation media. And replace the install.wim to the bootable usb and install the operating system with it, So I can have the drivers.

linux - Several companies networks in parallel isolation (developer network, normal network users, management, etc) and how to secure them?

Well so I want create multiple networks so that they exist in isolation from each other.



It aims to ensure that it:
a) has no redundant hardware (mail exchange, infrastructure, etc only once for all networks, but safe with isolation)
b) the networks do not threaten each other (a compromised network that will not affect the others have)
c) an exchange of data between the networks to be possible.




How do I put on the best approach? The networks have indeed because of their functions different requirements (sensitive data, isolation, external access to web, etc.).



I thought about a lot of work with terminal servers or through static routes in a direction to ensure the safety to charge the external server is not compromised internal server?



What are alternatives? Is there a best-practice how to build a corporate network?

How can I reinstall Windows 7 without an optical drive?




My wife has a Neo netbook with a manufacturer installed Windows 7 OS.


Is it possible to reinstall the OS without an optical drive, perhaps with a USB memory and the license code on the Windows sticker?

windows server 2008 - How do I run an elevated explorer on W8R2 with default UAC?

On Windows Server 2008 R2 with the User Account Control Settings at the third highest level when you start explorer as administrator it doesn't appear to actually grant administrative rights to the process.




Is there a way to leave UAC at that level AND be able to start an explorer process as a real administrator?

Batch rename folders with illegal characters * and :

I want to move thousands of folders and files from an old to a new storage system with Windows 2008 R2. Obviously a user with MAC OS has named hundreds of folders with characters - * and : - that Windows cannot read or rename, because it notices folders and files with illegal characters as invalid. In MAC OS these folders and files are valid.



So how can I batch rename these folders, in order to copy all the data to my new storage system within my Windows Server 2008 R2? Maybe with a renaming tool in MAC OS? Maybe with a renaming tool in Windows, that can read folders with illegal characters? Which one of them can search for such strange illegal characters, because searching with * finds all of the files and folders and : can also cause problems when searching.



I appreciate any help!

windows 10 - Disable one component of USB composite device that causes bluescreen when plugged in or booted

I just bought a cheap new netbook on clearance (Lenovo 100S) and I've been given a nice used external monitor (Dell SX2210).


The netbook only has two USB ports but the monitor includes a USB hub with four ports. It also includes microphone and webcam that work via the USB connection. (Monitor speakers require an audio cable rather than USB.)


Apparently this built-in webcam is known not to work with Windows 10. The system crashes with a BSOD when I connect the monitor to the netbook via the USB cable. It also crashes during bootup if the USB is connected.


Is there a way I can disable just the webcam component or its driver but retain all the other functionality? I would have to disable it when it's not plugged in, which I don't know how to do.




The first several crashes have this report:



On Mon 15/02/2016 2:13:42 AM GMT your computer crashed
crash dump file: C:\Windows\Minidump\021516-11609-01.dmp
This was probably caused by the following module: oa002afx.sys (OA002Afx+0x1C34C)
Bugcheck code: 0x50 (0xFFFFFFFF8B4575C0, 0x10, 0xFFFFFFFF8B4575C0, 0x2)
Error: PAGE_FAULT_IN_NONPAGED_AREA
file path: C:\Windows\system32\drivers\oa002afx.sys
company: Creative Technology Ltd.
description: Advanced Audio FX Driver
Bug check description: This indicates that invalid system memory has been referenced.
This appears to be a typical software driver bug and is not likely to be caused by a hardware problem.
A third party driver was identified as the probable root cause of this system error. It is suggested you look for an update for the following driver: oa002afx.sys (Advanced Audio FX Driver, Creative Technology Ltd.).
Google query: Creative Technology Ltd. PAGE_FAULT_IN_NONPAGED_AREA



The later crashes have this report. I'm pretty sure the change is due to my attempt to update the driver:



On Mon 15/02/2016 5:16:02 AM GMT your computer crashed
crash dump file: C:\Windows\Minidump\021516-11218-01.dmp
This was probably caused by the following module: ctauddrv.sys (CtAudDrv+0x1D16C)
Bugcheck code: 0x50 (0xFFFFFFFFB8BCE258, 0x2, 0xFFFFFFFF8B4575C5, 0x0)
Error: PAGE_FAULT_IN_NONPAGED_AREA
file path: C:\Windows\system32\drivers\ctauddrv.sys
company: Creative Technology Ltd.
description: Advanced Audio FX Driver
Bug check description: This indicates that invalid system memory has been referenced.
This appears to be a typical software driver bug and is not likely to be caused by a hardware problem.
A third party driver was identified as the probable root cause of this system error. It is suggested you look for an update for the following driver: ctauddrv.sys (Advanced Audio FX Driver, Creative Technology Ltd.).
Google query: Creative Technology Ltd. PAGE_FAULT_IN_NONPAGED_AREA


Monday, March 30, 2015

How to install DBAN (Darik's Boot and Nuke) on an USB flash drive larger than 4GB and make it bootable on an UEFI-equipped PC?


Disclaimer: I am answering my own question.




I need to wipe my Windows laptop's internal hard drive. I find DBAN per How-To Geek's recommendation, but I am having trouble installing it on a 64GB USB flash drive and make it bootable on an UEFI-equipped PC.


After downloading DBAN's ISO file from SourceForge, I first tried ImgBurn per the recommendation of an earlier How-To Geek article. I quickly realized that I misread that article because ImgBurn only burned to optical disks.


Next I tried was a tutorial from Tom's Hardware. That article suggested using Rufus. It did not specify which file system should I format the flash drive to during Rufus' burning setup, so I selected FAT32 as shown in the screenshot. However, since the ISO selected in the screenshot was "FreeDOS", the screenshot might be for illustration purpose only.


In the UEFI, the burned flash drive was shown as "[UEFI] followed by the flash drive's name". I moved it to the top of the boot order and tried to boot, but it did not work.


Afterwards, I found this question on , where User:terdon suggested that to make DBAN bootable, the flash drive should be set up with a single FAT partition.


I ran "clean" in diskpart and reformatted my flash drive with 512MB of space formatted as FAT and the rest unformatted. However, when I ran through the burning process again, Rufus insisted to format the entire drive for me, and I could only choose FAT32, not FAT. I restarted and that unsurprisingly failed to boot.


Next I came across this high-ranking (in Google search results) article from a website called Pendrivelinux.com, offering a software download called "Universal USB Installer". It did not seem to be an open-source software so I was a bit wary of it. But since I would be wiping my hard drive anyway I downloaded it and installed it.


The good thing about this software was that formatting of the flash drive was now optional during the burning process. So I reformatted my drive to FAT and burned DBAN's ISO to it, all without issue. But it still failed to boot when I restarted.


Answer



Disclaimer: I am answering my own question.




Here is the solution that worked for me, tested on a Windows laptop with UEFI and a 64GB USB flash drive.



  • Step 1: Download DBAN (Darik's Boot and Nuke)'s ISO file from SourceForge.


  • Step 2: Download Universal USB Installer from Pendrivelinux.com.


  • Step 3: Run Command Prompt as administrator. You may be able to do the same thing with Disk Management. But in my case Disk Management refused to let me delete the volume of my flash disk.



    • Step 3.1: Type diskpart and hit enter. This runs the diskpart utility.


    • Step 3.2: Type list disk and hit enter. This lists all disks (including your flash drive).



      • Step 3.2.1: Look for your flash drive (look for its size) and keep note of its number.


    • Step 3.3: Type select disk # and hit enter, where # is number of your flash drive (see step 3.2.1). This selects your flash drive as the target to operate on.



      • Step 3.3.1: Type detail disk and hit enter. This lists the detail of the currently selected disk. Make sure it is your flash drive.


    • Step 3.4: Before you proceed, please ascertain that you have chosen the correct flash drive and have no desirable data on it. Type: clean and hit enter. This cleans the selected disk of its partition and format.



  • Step 4: Run Disk Management. (You should be able to do the same thing with diskpart. But I have no advanced knowledge of diskpart so I prefer to use GUI whenever possible).



    • Step 4.1: Find your flash disk in the section below. It should have its entire space unallocated. Right click on the unallocated space and click "create new simple volume".



      • Step 4.1.1: In the wizard that appears, choose a volume smaller 2048MB. My knowledge is that a FAT-fomatted (FAT-16, to be specific) disk on Windows can hold a maximum of 4GB of data, with single file limited at 2GB. But since DBAN's ISO file is less than 20MB in size, there is no reason not to be safe. In my case I went with 512MB.


      • Step 4.1.2: Choose FAT as the file system.




  • Step 5: Run Universal USB Installer.



    • Step 5.1: Choose DBAN among the lists of available options.


    • Step 5.2: Browse and select the previously downloaded DBAN ISO file as the source image.


    • Step 5.3: Select your flash drive as the burning target.


    • Step 5.4: Do not select the option that asks you if you want Universal USB Installer to format the flash drive for you.



  • Step 6: Restart and boot into UEFI.



    • Step 6.1: In the boot order section, select the boot mode to be "Legacy" (it may be "BIOS" on your screen). This is the culprit that made my last attempt in the question fail. Apparently DBAN cannot be booted properly from UEFI.



      • Step 6.1.1: In some systems, instead of selecting between UEFI and BIOS boot modes in UEFI itself, you may need to boot into BIOS directly. Consult your motherboard/laptop manufacturers for instruction.



  • Step 7: Save and reboot. Hopefully you should boot straight into DBAN.



    • Bonus Tip: In some cases DBAN may wipe the flash drive it rests on as well, so if you do not want it to be wiped be sure to pull it out at the right moment.



Thank you for reading this rather lengthy answer! Had Windows 10's recovery options (Reset this PC > Remove everything > Remove files and clean this drive) worked for me I would not be spending so much time researching how to make DBAN work on my laptop. Little did I know.... I am glad that I can now share this solution with everyone who may run into a similar problem.


Comment if you have questions!


linux - How do I get the current date according to an NTP server without setting it locally?



I want to get the current date and time according to a remote NTP server, using Linux. I don't want to change the local time as a result; I just want to get the remote date, adjusted for the local time zone, printed out. The date returned must comply with the following criteria:




  1. It needs to be reasonably accurate.

  2. It needs to be adjusted for the timezone on the local system making the request.

  3. It needs to be formatted in an easily-readable or interpretable way (standard date format, or seconds since epoch).




What I've Tried:



I can call ntpdate -q my.ntp.server and get the offset between the local time and the server's time, but that doesn't return the date according to the NTP server; it just returns the offset and the local date.



Is there some easy way/command I can use to say: "Print out the date according to a given NTP server, adjusted for my current timezone"?


Answer



This Perl script should do what you need (assuming you don't need precision to the 10-6 of a second):



#!/usr/bin/perl -w


use strict;
use Math::Round;

## Get current date (epoch)
my $date=time();

## Get the seconds offset, rounding to the nearest second
my $ntp=nearest(0.1,`ntpdate -q $ARGV[0] | gawk '(\$NF~/sec/){print \$(NF-1)}'`);


## Get the server's time
my $ntp_date=$date+$ntp;

## Convert to human readable and print
print "The time according to server $ARGV[0] is " . localtime($ntp_date) . "\n";


Save the script as check_ntp.pl and run it with the server as an argument:



perl ./check_ntp.pl my.ntp.server


ssh - Is this server hacked or just login attempts ? See log



Can someone tell what does this mean? I tried a command like lastb to see last user logins and I see some strange logins from China (server is EU, I am in EU). I was wondering if these could be login attempts or successfull logins?



These seem to be very old and usually I lock port 22 to my IPs only, I think I had the port open for a while, last log is in July.




root     ssh:notty    222.92.89.xx     Sat Jul  9 12:26 - 12:26  (00:00)
root ssh:notty 222.92.89.xx Sat Jul 9 12:04 - 12:04 (00:00)
oracle ssh:notty 222.92.89.xx Sat Jul 9 11:43 - 11:43 (00:00)
gary ssh:notty 222.92.89.xx Sat Jul 9 11:22 - 11:22 (00:00)
root ssh:notty 222.92.89.xx Sat Jul 9 11:01 - 11:01 (00:00)
gt05 ssh:notty 222.92.89.xx Sat Jul 9 10:40 - 10:40 (00:00)
admin ssh:notty 222.92.89.xx Sat Jul 9 10:18 - 10:18 (00:00)

Answer




lastb only shows login failures. Use last to see successful logins.


windows - Unable to Make Bootable USB Stick From ISO


I'm trying to use the Windows 7 USB/DVD Download Tool from the Microsoft Store to make my new 16 GB USB Flash drive bootable to install Windows. It worked the first time that I did this (for Windows 7 Pro 32-bit), but now it keeps failing at the end. (I'm trying to make it bootable with the Windows 7 Pro 64-bit installation DVD ISO.) I've tried to do this on two different computers (Windows XP Pro 32-bit & Windows 7 Pro 32-bit) with the same error:



Files copied successfully. However, we were unable to run bootsect to make the USB device bootable. If you need assistance with bootsect, please click the "Online Help" link above for more information.



Clicking the link just takes me to the Microsoft store homepage, and a search for bootsect from there yields no search results. I've tried to burn a DVD twice using Sonic RecordNow!, but even though it finishes without "errors," the disk is unreadable. :( Does anyone know why this keeps failing and how I may fix it?


Answer



It would seem that bootsect was failing because the device was already bootable.


This morning I decided to try using it to boot with the Windows 7 Professional 64-bit installer image loaded on it, despite the failure, just to see what would happen. Surprise-surprise, it worked. -_-


Windows Batch-File to execute and communicate with running program

(How) can a program with interactive command line mode (shell) be programmatically "interacted" with from CMD.exe via batch file (.bat)?
Example:


>program.exe
>>aCommand
>>someResponse
>>anotherCommand
>>someotherResponse
>>quit
>

The batch file should start program.exe, send aCommand, then [optionally] wait for someResponse and so on.


There's How to interact with command-line program using batch file? but does not need automated interaction and so accepts CALL as answer.


Maybe it's possible to start the process separately and then pipe commands and responses to communicate with it?




Elsewhere:

networking - WAN and LAN setup for IPv6

We just got a IPv6 /48 range (a gateway and an IP address) for our company, but I'm unsure about how to set it up. We use FreeBSD 8.4 (pfSense 2.1) as a router/firewall.



Currently we have IPv4 setup with a WAN towards the internet, and a NAT-ed LAN behind it for office PCs.




We want to keep the LAN network for security, and we want IPv6 addresses from the /48 for all office PCs (without NAT).



The WAN is configured with the IPv6 gateway 1111:2222:3333::1/48 and interface address 1111:2222:3333::2/48. But when it's configured this way, I guess it's impossible to fit the LAN on a /64 within the /48?



I believe I should configure the WAN subnet on 1111:2222:3333:1::/64 and the LAN on a subnet like 1111:2222:3333:2::/64. Is this something I can configure myself, or do I have to ask the ISP to configure that routing for me?



Current test setup:





  • WAN gateway 1111:2222:3333::1/48

  • WAN interface (em3) 1111:2222:3333::2/64

  • LAN interface (em1) 1111:2222:3333:1::1/64

  • Test client on LAN 1111:2222:3333:1::abcd/64



netstat -r shows:



Destination         Gateway            Flags      Netif Expire
default 1111:2222:3333::1 UGS em3

localhost localhost UH lo0
1111:2222:3333:: link#4 U em3
1111:2222:3333::2 link#4 UHS lo0
1111:2222:3333:1:: link#2 U em1
1111:2222:3333:1::1 link#2 UHS lo0


I can ping the WAN gateway from the router. From the test client I can ping the LAN & WAN interfaces, but not the WAN gateway.



If I try to add an explicit route, I get an error:




$ route add -inet6 -net 1111:2222:3333:1::/64 1111:2222:3333::2
route: writing to routing socket: File exists
add net 1111:2222:3333:1::/64: gateway 1111:2222:3333::2: route already in table

windows 10 - How to combine all partitions of USB flash drive?


I hope this is the right place to post this.


I have an SP brand 32GB USB flash drive. When it was brand new I installed the TAILS OS on it and it seemed to create a bootable EFI system partition of 8GB on it, at least that's what Windows 10 Disk manager says.


Then I used Windows 7 to look at it, as I was missing 20.87GB of storage that was on the drive but not on the partition.


Then I used Windows 10 Disk Manager to make the unused 20.87GB part into a partition of an NTFS file system. Now I have 2 partitions on the same flash drive and can't use the 8gb partition on Windows.


How do I make the whole flash drive one big 28GB partition?


Via Windows 10 Disk manager I cannot do a thing with the 8GB EFI partition that TAILS created, I can't delete it or expand it. I even tried installing AOMEI partition software (free version) and could not do a thing with that either.


I've been searching web pages for about 3 hours now and have not found a solution. Other pages on the web and on here talk about similar issues but not about how to remove the EFI partition so the NTFS partition can expand to use all available space on the flash drive.


I can't use FDISK on cmd.exe because that requires a drive letter and in this case, the NTFS partition has a drive letter but not the EFI part of the flash drive. So fdisk won't affect the EFI partition.



  1. A single FAT32 partition would be fine, whatever works with Windows 7, 8 and 10.

  2. I'm fine losing all data on this flash drive and just making it one big partition.


Thanks!




EDIT: Diskpart in Windows 10 displays this info:


DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 118 GB 0 B
Disk 1 Online 931 GB 0 B
Disk 2 Online 28 GB 1024 KB *

When I selected disk 2, partition 1 (first partition) and tried to delete it I get this error:



Virtual Disk Service error:
Cannot delete a protected partition without the force protected parameter set.



Answer



The article
How to Delete EFI System Partition in Windows
recommends using diskpart for deleting the partition, as follows.


The first step is to change the partition id, in effect converting it from EFI
to data:


list disk          (displays all disks)
sel disk N (select the EFI partition by its number N)
list partition (displays all partitions including EFI)
sel partition N (select the EFI partition by its number N)
SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

Once this is done, to delete the EFI partition with diskpart:


delete partition override

If successful, you will get the message
"DiskPart successfully deleted the selected partition".
Use the exit command to close diskpart.


CPU overheat after cleaning the fan


I have decided to clean my computer. I opened it, removed the fan from the CPU and cleaned it. It was jammed with a lot of dust. After I put it back, and it rotates much smoother and better, I started to get CPU over heat error. I never got it before. It's a bit ironic that after cleaning the fan my computer hangs and send a CPU over heat error. After restart it says "CPU overheat, press F1 to continue".


I think of two options:
1. I miss located the fan over the CPU and so it really overheat.
2. I somehow ruined the heat detector and it thinks it's over heating.


I even tried to disable CPU temperature monitoring in the BIOS, and yet, the computer auto-restart and says CPU overheat.


What can I do?
How can I know that I have placed the fan correctly?
How to know if the temperature detector is OK?


The computer I have is ASUS pundit 350:


Thanks.
Aviv.


Answer



Most likely is that you CPU fan is not properly anchored. This causes that the metal could not lead away all the head.
Another thing could be, that there is too little heat paste (the white sticky stuff).


Best thing for this problem is to clean your CPU and fan and apply new paste on one (!) side. Spread it a little so nearly all of your CPU is covered. Don't take too much 1-3 pinheads of paste should do it.


Sunday, March 29, 2015

monitoring - Command that will take a 'system snapshot' of a linux system for later diagnosis?

I am running a Ubuntu Linux server with Apache, wsgi, django and mysql on it. Recently something happened and the wsgi processes frooze up. Restarting apache solved the problem. As with many live systems, it's better to get the system back up and running rather than poking around. However we are having trouble diagnosing the problem, since everything looked fine, and we don't know the full state of the problem now.



Is there any tool/command (on linux/debian/ubuntu (or any other *nix flavour, I'm fine with compiling any command)) that, when invoked, will write to a file some details about the state of the system as it is now? If/When this happens again, we can just run this command, then get down to fighting some fires (restarting apache/the server etc.), and then later, we can try to diagnose the problem.



Wishlist of things it would record:





  • CPU status (and various types)

  • Process list & various detailed

  • Details of file system usage

  • List of all open files (and what process has them, etc.)

  • List of all open internet connections

  • (If possible) Details of what our mod_wsgi processes are doing

  • MySQL status: current queries that are being run, etc.

  • (maybe) run strace on apache/mysql/mod_wsgi for a few seconds to collect some data of what they are doing, and save this to a file.

  • Anything else I'm forgetting?




In theory this is a simple set of commands and if no-one else has done this, then we'll just write our own scripts, but it would be better if we can use a proper tool.

domain name system - PTR record created, but not found

We are a small ISP, using linux DNS servers. Recently a client has asked us to create a rDNS zone for a specific IP address, which is used for a mail server. They keep getting message failures for some emails due to lack of PTR records and valid rDNS.



We created the rDNS zone the same way as all of the other rDNS zones are created. The only difference is that, outside of our network the PTR record is not found, but only for that specific IP address.



Does anyone know what could be the cause of this?

performance - Is my CPU causing bottleneck for the whole system?


I have this old laptop which I have been using for past 2 years. It works well except sometimes when I use programs like Photoshop and Eclipse, it takes a long time load. Also, there are some minor delays here and there as far as I can tell.


So, after researching a while, I thought upgrading it will be more economical than buying a new laptop. So, I went ahead with it. I have upgraded the RAM from 4GB to 8GB and install a Samsung Evo SSD to replace my old hitachi HDD.


After that, I can feel the faster boot time, loading etc. But the loading time for some of the programs hasn't improved much as I originally thought.


So, my question is is my CPU causing a bottleneck for the whole system?


enter image description here


Answer



Short answer is "most likely yes".


Long answer is:


You should be able to feel quite a big difference from the way it was before having upgraded the SSD and memory.


But seeing as you are having problems with some quite demanding programs specifically (Photoshop and Eclipse) I would guess the CPU could be a bottleneck here. However, loading programs is usually not all that CPU intensive, but more likely to put a strain on IO activity (memory and HDD/SSD).


I would suggest you run through the "optimizer" application that came with the SSD.


Alternatively at least check the following settings manually:



  • Re-run the Windows Experience Index clasification (this also detects your new SSD and changes settings accordingly)

  • Remove indexing from the C:\ drive (or whatever drive Windows is on)

  • Make sure you have set virtual memory to the appripriate size (I would suggest a 8192 MB fixed swapfile)


But the i3 1.8 GHz CPU that's in your laptop is really not that fast, as you can clearly see on this chart and read in this article compared to other Intel CPUs of roughly same generation.


apache 2.2 - Why can my servers not access their own addresses?




I have two VMs on CentOS 6.5, running Plesk 12, and the webserver is Apache 2.2. One is a clone of the other, and I inherited them setup by someone else. My problem is that I can access my sites hosted on the servers from any computer other than these servers themselves.



Say example.com points to one of my servers. If I am SSH'd into either of the servers and run
wget example.com I will get back:



--2014-10-20 18:01:42--  http://example.com/ Resolving example.com... 
Connecting to example.com||:80... failed:

Connection timed out. Retrying.


The IP address it resolves to is correct. If I run wget on the servers using the IP address directly I have the same result negative result.



If I run wget to the same domain on a computer outside these VMs I resolve to the same correct IP, and I am connected. Using localhost on the VMs does work fine:



wget localhost
--2014-10-20 18:12:35-- http://localhost/
Resolving localhost... 127.0.0.1

Connecting to localhost|127.0.0.1|:80... connected.


The problem seems to be that the servers don't know what to do when they get to the IP address, and I'm at the end of my knowledge in this area. Any direction on this is appreciated!


Answer



You need a route which directs the traffic to your local interface, and you may have a firewall issue.



Add the output of netstat -an for routing. It's likely to be ipchains -L or iptables -L to list the firewall rules.


connector - LCD screen to HDMI or VGA

I have an old laptop with a completely working LCD screen, and am wondering if there is any way for me to turn it into an external monitor by converting the flat cable to a VGA or HDMI output.


Anybody know of any way for me to do this, preferably without any extra COTS parts?

zip - Unzipping from Flash Drive and Drive Wear


If I have a zip file on a thumb flash drive and I want to unzip it to hard disk, is there any write activity on the flash drive, or is it reading only?


Because if there is any writing, I would want to copy the zip file over to the hard disk first to avoid flash drive wear.


Answer



Unzipping compressed files (including .zip files) does not require any writing to disk. All decompressed data is stored in RAM, and then copied to the destination. So if you unzip an archive from a flash drive, to an HDD, then there's no write activity on the flash drive.


I should also point out, depending on the flash drives age/make/model, you shouldn't need to worry about write cycles.


powershell - How to rename some files according to their timestamp


suppose I have 10 files generated by the system every day under D:\Temp. The names are RANDOMLY when generated.


Assume I need to rename the oldest one to be 'aaa', the second oldest one to be 'bbb'..then 'ccc'...'ddd'.


can someone help to write batch script? Powershell cmdlt will be good as well.


Thanks!


Answer



Here is a solution using a list of names:


$names = @('one.txt', 'two.txt', 'three.txt', 'four.txt', 'five.txt', 'six.txt', 'seven.txt', 'eight.txt', 'nine.txt', 'ten.txt')
$count = 0
foreach($file in (Get-ChildItem i:\temp | Sort-Object LastWriteTime | Select-Object -First 10)){
Rename-Item $file.FullName (Join-Path $file.DirectoryName $names[$count])
$count++
}

iso image - Reinstall Windows 10 using ISO onto new SSD without losing activation status

I bought my laptop that comes pre-install Windows 10 Home Single Language (activated).

However I wish to reinstall the my current Windows onto a upgraded SSD drive.

And I don't wish to lose my activation after reinstall.

Therefore I don't want to download any ISO file comes from outside sources

I wish I can create my own ISO from my current installed Windows OS.

Is there anyway I can do this?

Can I use the Backup and Restore (Windows7) comes from Control Panel to create this?

Will it lose my activation?

Can it reinstall onto different drive? (I remembered I did once before with a USB flash drive that only run UEFI menu to restore my Windows but without option to install onto different drive)

windows 8 - Too much RAM "in cache"


I am having the following problem: I am having a completely new Notebook with 8 GB RAM and Windows 8. I do not use software that requires a lot of RAM and I do not have a thousand programs running. Despite, Windows keeps on complaining about the fact that I would not have enough RAM available. When I checked this via Task-Manager I saw that I only used 1.5 GB RAM and the rest was "used as cache" whatever this means.


My question is now: Is there any way to get my RAM from this cache-guy back?


Answer



Clear your ram cache with RAMMap's emptystandbylist option.


http://technet.microsoft.com/en-us/sysinternals/ff700229.aspx


Alternatively, wj32 (writer of Process Hacker at sourceforge) has written a small cmdline app to do the trick. Find it in this thread.


http://forum.sysinternals.com/rammap-empty-standby-list_topic27297.html


Have not found a way to do this from Powershell yet, but if you are a good programmer you can find what you need in the source code of Process Hacker.


linux - How can I port forward with iptables?



I want connections coming in on ppp0 on port 8001 to be routed to 192.168.1.200 on eth0 on port 8080.



I've got these two rules




-A PREROUTING  -p tcp -m tcp --dport 8001 -j DNAT --to-destination 192.168.1.200:8080

-A FORWARD -m state -p tcp -d 192.168.1.200 --dport 8080 --state NEW,ESTABLISHED,RELATED -j ACCEPT


and it doesn't work. What am I missing?


Answer



First of all - you should check if forwarding is allowed at all:




cat /proc/sys/net/ipv4/conf/ppp0/forwarding 
cat /proc/sys/net/ipv4/conf/eth0/forwarding


If both returns 1 it's ok. If not do the following:



echo '1' | sudo tee /proc/sys/net/ipv4/conf/ppp0/forwarding
echo '1' | sudo tee /proc/sys/net/ipv4/conf/eth0/forwarding



Second thing - DNAT could be applied on nat table only. So, your rule should be extended by adding table specification as well (-t nat):



iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 8001 -j DNAT --to-destination 192.168.1.200:8080
iptables -A FORWARD -p tcp -d 192.168.1.200 --dport 8080 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT


Both rules are applied only to TCP traffic (if you want to alter UDP as well, you need to provide similar rules but with -p udp option set).



Last, but not least is routing configuration. Type:




ip route


and check if 192.168.1.0/24 is among returned routing entries.


memory - Corsair & G.Skill DDR4 Ram compatibility



My configuration:
Processor: G4560
Motherboard: MSI B250M PRO-VH



Can I use these two rams in dual channel ?




Corsair DDR4 2400 8GB



G.Skill DDR 2400 4GB



I know that both of them need same speed, timing & voltage to use in dual channel mode. I couldn't find any timing in their specs & their latencies are different . Will different latency cause a problem?



I have DIMM A1 & DIMM B1 slots in motherboard. Where should I put which ram for better performance ??



Thanks



Answer



The "latency" parameter you see in their specifications are the timings (if they are 4 numbers like 1-2-3-4).



Different timings will cause a problem and latency is one parameter of the RAM timings.
Insert the RAM sticks into two different channels (one into channel A, and the other one into channel B), since they can't work together in dual-channel, however, this won't really make a difference for performance in your case.



Explaining timings:
Timings are usually written down in the a-b-c-d (CL-tRCD-tRP-tRAS) format.
The abbreviations for those timings are as follows:




CL: CAS Latency. The time it takes between a command having been sent to the memory and when it begins to reply to it. It is the
time it takes between the processor asking for some data from the

memory and then returning it.
tRCD: RAS to CAS Delay. The time it takes between the activation of the line (RAS) and the column (CAS) where the data
are stored in the matrix.
tRP: RAS Precharge. The time it takes between disabling the access to a line of data and the beginning of the access to another
line of data.
tRAS: Active to Precharge Delay. How long the memory has to wait until the next access to the memory can be initiated.




If you want to read more:
Source: Hardware Secrets - Understanding RAM Timings


networking - Network monitoring windows vista




I need an application(freeware) for Windows Vista which shows me the current network
usage by individual applications. Can you suggest one?

Windows Apache 2.2 painfully slow executing CGI

I've recently set up Apache 2.2 and git on one of our Windows XP PCs for gitweb access using the setup at https://git.wiki.kernel.org/index.php/MSysGit:GitWeb
As noted on the wiki, the only version of Perl that seems to work with gitweb the way it is coded is the one included with MSysGit. ActivePerl and StrawberryPerl don't implement a certain required feature so another interpreter is not an option.



C:\Program Files\Git\bin>perl.exe --version
This is perl, v5.8.8 built for msys


In any case, it is set up and it works but for some reason there is an approximately 10 second delay for every page load. To troubleshoot this I made a simple helloworld.cgi and placed it in the directory next to gitweb.cgi. It is set up to use the same perl interpreter as gitweb:




#!C:\Program Files\Git\bin\perl.exe
print "Content-type: text/html\n\n";
print "Hello, world!\n";


This script too takes over 10 seconds to execute on the server. If I fire up a command prompt and execute it directly with the same perl executable, it executes instantly.



mod_cgi is loaded in the Apache config and I'm using the config stanzas shown on the git wiki modified for my system:



# Config to make the gitweb CGI available through Apache.

Alias /git "C:/Program Files/Git/share/gitweb"

AddHandler cgi-script .cgi

Options +ExecCGI

AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex gitweb.cgi




Are there some other config directives I'm missing? It doesn't seem to matter whether I access it from another PC or via localhost directly on the machine so I think that rules out DNS. It isn't dumping anything into the Apache error log, either.

microsoft word - How not to show pasted hyperlinks as a hyperlinks?


When I copy a hyperlink text such as a website address and paste it in MS Word, how can I just paste it as a plain text instead of a hyperlink?


Answer



To avoid the automatic recognition mentioned by @Dave:



  1. Hit Space then Left Arrow to get before the space.

  2. Hit Ctrl+Alt+V to Paste Special.

  3. Select "Unformatted Text" and hit OK to paste.

  4. Hit Right Arrow to move after the URL without triggering the automatic detection.


It's faster to do than to describe!


Saturday, March 28, 2015

Can Windows 10 have a partition type of GPT with a UEFI boot mode?

Can Windows 10 have a partition type of GPT with a UEFI boot mode?



You'd need to ask somebody from Microsoft why they tie their
partition table type (GPT vs. MBR) to their boot mode (EFI/UEFI vs.
BIOS/CSM/legacy). Other OSes are capable of installing to GPT disks in
EFI/UEFI mode.



https://superuser.com/a/926856/55747


The implication of the second sentence is that Microsoft cannot install to GPT disks in UEFI mode.

linux - How should I mass rename files to fix Dropbox (false) detected "conflicting" version to "non-conflicting" version?

I have a project with many files, located in several sub-directories.
Dropbox somehow replaced the latest versions of some of those files with an old version and renamed the latest ones by adding " (Johns in Konflikt stehende Kopie 2013-03-17).txt" to tmen.



Now, I need to rename all files that have that addition " (Johns in Konflikt stehende Kopie 2013-03-17)" to the original filename, removing the old "authoritative" version (as Dropbox saw them).



Is there a shell script or something to run in terminal for a certain directory, which would do this recursively on a target directory?



For example:

"filename (Johns in Konflikt stehende Kopie 2013-03-17)" should be renamed to "filename" and in case there was already a file called filename, remove that first.

macos - How to delete files from NTFS formatted external drive using OS X?




I have a 1TB external hard drive that I think is formatted for Windows (NTFS?) but I have a Mac.


Right now I can view the data on there but I can't delete any of it.


Is there something I can do to be able to change the format to be able to delete stuff without removing any data and totally reformatting the external hard drive?

boot - installing windows on a new SSD hard drive

I've purchased a new SSD hard drive for my laptop. I put the SSD into the HDD's place and put the HDD into the DVD rom place. at first there was no problem, the computer detected both of them and they were listed in the boot option. when I tried to install windows on the SSD, it said that this drive is MBR and it should be GPT. I converted it to GPT using AOMEI, and tried to install the windows but it gave me this error


windows cannot install required files. the file may be corrupt or missing...
error code :0x80070570


at first I thought that my device or the files had a problem. I tried with different windows files and different flash drives but the error occurred every time.
then I realized that after I've changed the SSD type to GPT, it is not shown as a boot option in the boot menu. I converted it back to MBR, it came back to boot options!!


I formatted my old windows drive on the HDD, hoping that it would help, but it didn't! and now my HDD is not listed in boot options either!!


no GPT drive is being listed in my boot options. when I convert the SSD to MBR it is one of the boot options. and windows cannot be installed on an MBR drive. I can't even install windows on my old drive! it gives me the same error. I used to install windows 10 and others on this HDD without any problem and it is gpt. I don't know what to do! my bios is updated. my laptop is Asus x450cc


please help me!

Why does Puppet need two runs to update bash?



Im learning puppet, and Im trying to update bash (no prizes for guessing why).




This is in my site.pp



       file { "/etc/apt/sources.list.d/shellshock.list":
source => "puppet:///files/shellshock.list",
owner => "root",
group => "root",
mode => "0644",
ensure => present,
}

->
exec { "instantRepoUpdate":
command => "/usr/bin/aptitude update",
refreshonly => true,
}
->
package {"bash": ensure => latest, }


From what Im reading here https://docs.puppetlabs.com/puppet/latest/reference/lang_relationships.html

That should translate to:



Install /etc/apt/sources.list.d/shellshock.list, then run aptitude update, then make sure bash is on the latest version



It does, but only over two runs of the agent. I want it to perform all three actions, in order, in one run.



UPDATE: I've tried adding "require => Exec[.., require => File[..." to the exec and package resources, I get the same result.


Answer



You set refreshonly => true and as such you need to use a notification arrow instead (~>).


Windows 10 "optimize drives" shows SSD as "hard disk drive"



I upgraded my old computer with a Samsung EVO 850. I did a clean Windows 10 installation.



Installed Samsung Magic and fixed all the AHCI settings. Now I have full 6Gb/s transfer speed.




However, my problem is Windows "Optimize Drives" tool wants to defrag my SSD like a hard drive. As far as I know, this is bad.



The rest of the OS works fine, and my 3rd party programs see that it's a SSD.



CPU: Intel Core i7 (4th gen)
Mobo: Asus P7P55DE_PRO
RAM: 8GB


Answer



Windows detects the type based on the benchmarks results. Run winsat formal from a cmd.exe, started as admin to bench the drive again.



Now Windows should detect the drive again as SSD and should only TRIM it and don't do a fully defrag.



memory - Windows 8.1 only uses 50% of RAM


Windows 8.1 uses only 50% of my installed 4GB memory which causes games to crash. System information state that 3.71GB are usable). The picture below is from my Task Manager showing the memory (Arbeitsspeicher in German). The graph below shows the memory usage for the last 60 seconds, and to the right you can see that roughly 50% (of 3.71GB) is used. 60 seconds before I took the screenshot, a game crashed due to memory problems.


Only 50% is used


I also noticed that memory composition (the graph below) remains fairly stable when it comes to "Free memory" (far right). Mouseover information says that free memory can be used once necessary, but it doesn't seem to happen. Memtest86+ says all memory is working fine.


System specifications:



  • 64bit architecture

  • dual boot with Ubuntu 14.04

  • pagefile.sys set to 6144MB manually (as an unsuccesful attempt to solve the problem)


This question is not related to two other questions (How to enable 4GB in my Windows 7 64 bit?) and (64-bit Windows 7 can only use 3.25GB of RAM instead of 4GB?).


Answer



By default 32Bit application still only use 2GB of RAM under a 64Bit Windows like they do on a 32Bit Windows. To allow 4GB of memory usage under a 64Bit Windows the IMAGE_FILE_LARGE_ADDRESS_AWARE flag must be set. If the developers haven't set this flag with the /LARGEADDRESSAWARE linker option during compilation you can use a tool which sets the flag in the executable to allow the 32Bit program to use 4GB of RAM.


microsoft word - Make the Print dialog ask for confirmation when printing the entire document

It happens too often that I'm only wanting to print one page, but I move too fast and the entire document starts printing.


Is there a way to set up a large Word document to verify that I only want to print the current page I'm on?

Friday, March 27, 2015

Why does VMware VM believe its disk usage is larger than it is?

In VMware Workstation 10 I can go to the VM menu, Manage, "Clean Up Disks..." and then magically, it will reclaim a ton of space.


What I don't understand is how the resulting folder for my VM is now only 80.1 GB. If I boot Windows in the VM and view the disk usage, it's about 91 GB. How is this possible?

sed - Unix: Search and replace in file names


Using sed, I can search and replace text in a file. Is there a way I can do search and replace of filenames? For example if I have a bunch of files in a folder with names like these:



  • foo01

  • foo02

  • bar001

  • bar002


I would like to quickly rename all of the ones starting with foo so that they have 3 digits instead of 2.


Answer



#!/bin/bash
shopt -s nullglob
for file in foo*
do
filename=${file%%[0-9]*}
num=${file##*[^0-9]}
newnum=$(printf "%03d" $num)
newfile=${filename}${newnum}
mv "$file" "$newfile"
done

hyper v - Best method(s) to backup VMs running on HyperV?





We're in the middle of P2V'ing most of the network, so the current backup method is likely the worst - the backup agent is still installed on the guest OSs, and the backup device is dutifully pulling them onto tape, one file at a time.



I suspect there's a clever way to script (PowerShell?) a suspend on the VMs, then backup of the .vhd files, and unsuspend the VMs. This seems like it would provide big speed benefits, while losing file-level restore (might be best for things like DCs and app servers).



What methods/policies have you hammered out?


Answer




Regular file-level backup of only data should still be used - regardless of if the machine is virtual or not. Backing up the disk file however is a great aid in increasing recovery speed for disasters if the entire guest fails.



There are several approaches to backing up the guests with scripting. You could shut it down, copy the vhd and start it again. A clean system backup. But what you probably want though is creating a snapshot. There's also a mount tool to get to the shadow copies programatically so you could actually move them off the volume as well. There's some debate on how stable the VSS-based snapshot system really is and people have lost data. It's a bit (ok, much more) involved than the approach used by Vmware as far as I can tell and is a bit more annoying to deal with.



I think there's a service pack or patch to the Windows Server 2008 Backup tool that makes it capable of backing up the guests transparently by the way?



Also see Microsofts planning for Backup with Hyper-V.


Windows 7 fresh install won't boot without 2nd harddrive, missing boot partition?


I just tried to upgrade my wife's computer to an SSD for silence and speed.


To do the install I physically added the new SSD to an empty SATA port and then used the Windows 7 install disk to put a fresh copy on the SSD. During this process I left the original hard drive attached to the system. My wife then just copied the files she wanted from the old drive to the new SSD.


Yesterday, I removed the old drive and the SSD will not boot. It appears that the SSD is missing the boot sector altogether. It is also missing the recovery partition normally seen on Win 7 boot drives. It appears that the Win7 installer just used the boot loader on the original drive. I should have disconnected the original drive while I installed Win7 on the new SSD. Here is my question.


Is there a way for me to fix the SSD to be a stand alone boot drive?


I would rather not start over from the beginning because my wife has the new SSD all set up the way she likes it.


Thanks for any advice.


Pete


Answer



Yes you can.


Find out from diskpart,list disk,select disk 0,list partition,select partition #N,detail partition about what drive letter your windows drive has (say C:).


Then, bcdboot C:\Windows /s C: /f BIOS to regenerate all boot files.


Hard Disk Not Being Recognized: "Reboot and Select proper Boot device"

I built my computer about 3 months ago. It has a Seagate Barracuda 7200.12 1TB HDD (model ST31000524AS) on an AsRock 970 Extreme Mobo. My HDD was split into 3 partitions, a partition for windows 7 ultimate 64bit, a partition for ubunu 11.04, and a partition I use to store files. Last night I went to bed while my brother was playing Skyrim on my computer. He said there were no problems when he went to bed last night, but when I woke up this morning, I received the POST message "Reboot and Select proper Boot Device or Insert Bootable media in selected boot device and press a key". I tried switching both the power and sata connections on my CD drive, which still works., and that made no difference. I have no devices except for my monitor plugged in. What's more is that in the UEFI, it doesn't even show my HDD, and when i try to run windows 7 repair with the installation disk I have, there are no Operating Systems, partitions, or any other things to be repaired.


EIDT: After running seatools for dos off a cd, it instantly failed the tests because it could not access the drive. I had a friend put it in his rig and got the same results.

motherboard - DDR3 memory modules: Should they be identical?


Is it true (or a legend) that when I insert more than one DDR3 1333MHz
(or, more generally, any DDR) memory modules into a computer, the modules should be identical and of the same model and vendor?


What about for example one 4GB module and another 2GB module into the same computer? May it lead to bugs?


Also: Should the modules occupy the lower numbered slots on the motherboard? (for example, if I use slots 2 and 3 of available slots 1, 2, 3, 4, may it lead to bugs?)


Answer



Yes, it is best practice to use identical memory modules. You cannot mix DDR with DDR2 or DDR2 with DDR3 or vice versa. You want to make sure each stick has the same cas latency, timings and voltage.


You can however mix different DDR3 models because they would have these same latency, timings and voltage. Where if one was slightly faster, the motherboard will underclock the faster one. This is still not recommended.


As for the where the memory modules should be occupied on the motherboard slots, usually motherboard specifies what slots should be used and organizing the slots or banks by color. It will not run in dual-channel mode if they are not in the correct banks with matching memory modules.


Apache SSL reverse proxy breaks Liferay Authentication

I have Apache 2.2. installed with SSL. It is running as a reverse proxy based on a question I asked and was answered here: Apache SSL reverse proxy for multiple servers What I discovered, however, is that the "sign in" prompt in Liferay no longer will authenticate. In FF I am given a security warning but my userid and password does not work. In other browsers, no security warning is given, but the authentication fails. Yet, if I use the IP address in the ProxyPass directives to go to the web page and then sign in, all is well. I assumed that Apache is passing all traffic back to the server unencrypted.



So, I am guessing that the data is getting mangled (somehow) in the ProxyPass directives so that Liferay cannot read the data. Is there another directive I need to add to the VirtualHost entry so that the data is passed unencrypted (or unmangled) to Liferay?



So, based on the post referenced above, when I go to http://www.mydomain.com I am redirected to https://www.mydomain.com which is properly hitting the http://192.168.20.200 server but the authentication fails. If I go directly to http://192.168.20.200 I can authenticate just fine. So somewhere in the https:// to http:// translation, something is getting hammered (I think).



Did I miss something in the VirtualHost directive that is messing up the authentication?




Thanks

excel, find last previous date


I am trying to get the next matched date from one column to the next.
So far I have tried getting the minimum of col F, =MIN(F2:F60) .
Now In another sheet in column D, I want to match this and if I cant match find the closet previous date.


In the below my last date is 11-Sep-2018, So I want to look into another column and return 11-Sept-2018 or the closet previous date, which could be anything before sept 11.


enter image description here


dont mind the duplicates.


Answer



Use VLOOKUP


=VLOOKUP(MIN(F2:F60),Sheet2!D:D,1,TRUE)

Windows 8.1 failing to install updates and unable to install Windows 10 (not sure if related)


My computer is currently running Windows 8.1 Pro with Media Center, and for several months has been failing to install a number of important Windows updates, shown in the screenshot below. After installing the updates, I restart the computer as required, then a message reading something like "Failed to configure updates, reverting changes" is displayed. The same cycle occurs when I attempt to install the updates again or when they're installed automatically.


I've tried installing them individually as well as just selecting updates that haven't failed previously but Windows seems to try installing all of them regardless and reverting changes as before (e.g. I select 1 update, then a message saying "Installing update 1 of 23" is displayed on restart despite only selecting 1 update). This means I'm unable to find exactly which update is causing the problem.


Also, recently I reserved a copy of Windows 10 for my computer. However, the app said Windows 10 is downloading in the background for several days of using my computer and Task Manager showed virtually no network usage from the app, and clicking the "View download progress" button closed the app. Could this be because the app is waiting for all Windows updates to be installed before it actually downloads Windows 10? Even worse, the Get Windows 10 notification seems to have now completely disappeared.


So my question is: Does anyone have any ideas for fixing these issues of Windows updates failing to install and Windows 10 not downloading, and are they related?


Screenshot


Answer



Update to Windows 10 via official tool: https://www.microsoft.com/en-us/software-download/windows10


ufw deny network rule not working

Someone keeps trying to login in my dovecot server. I have added a ufw deny rule for a network since he keeps picking different addresses from the same small network, but these deny rules don’t seam to have any effect. It’s only when I specify an IP address that the rule has apparently an effect.



I changed the listening port of the dovecot server, but he finds the new port and keeps trying to login.



The network that I want to filter is 185.211.245.128 - 185.211.245.255.



I have postfix and ssh ports open, but he focus on dovecot.



These are the rules I have set in ufw





Anywhere DENY 185.211.245.128/25
Anywhere DENY 185.211.245.0/24
Anywhere DENY 185.211.245.170
996 DENY 185.211.245.170
996/tcp ALLOW Anywhere


Only the last deny had effect. I have now connection attempts from another address from this network.




I added the network deny rules with the following command:




# ufw deny from 185.211.245.128/25


Why is ufw not taking these deny rules into account ?



Update 1: I rebooted and got an hour relief, but I get connection attempts again. iptables look correct:





Chain ufw-user-input (1 references)
pkts bytes target prot opt in out source destination
3 180 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:xxx
32 1672 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
19 1092 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
22 1268 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:587
7 424 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:465

0 0 DROP all -- * * 141.98.80.16 0.0.0.0/0
0 0 DROP all -- * * 5.79.252.176 0.0.0.0/0
0 0 DROP all -- * * 5.53.119.178 0.0.0.0/0
5 200 DROP all -- * * 185.211.245.128/25 0.0.0.0/0
0 0 DROP all -- * * 185.211.245.0/24 0.0.0.0/0
0 0 DROP all -- * * 185.211.245.170 0.0.0.0/0
0 0 DROP tcp -- * * 185.211.245.170 0.0.0.0/0 tcp dpt:996
0 0 DROP udp -- * * 185.211.245.170 0.0.0.0/0 udp dpt:996
0 0 DROP all -- * * 168.228.151.234 0.0.0.0/0
0 0 DROP all -- * * 185.211.245.198 0.0.0.0/0

34 2160 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:996


Apparently 5 packets were rejected by rule deny 185.211.245.128/25. But I now have again connections from 185.211.245.170.



This is what I see in auth.log. I rebooted before 12:00.




Feb 18 12:37:28 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 12:37:31 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170

Feb 18 12:37:58 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 12:38:00 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 13:11:12 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 13:11:14 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 13:11:33 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170
Feb 18 13:11:36 srv01 auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=xxx rhost=185.211.245.170


It looks like iptables is not properly working or could be circumvented.




The dovecot process is listening on 0.0.0.0:996 and :::996.



Update 2: even stranger. Looking in the ufw.log, I see that connection attempts from my home to the server at port 996 were rejected during this night. But I did manage to access my imap server at that same port yesterday evening. Something is really fishy.



Update 3: I had fail2ban running. Since I stopped fail2ban, which result in removing the rules in iptables, no more failed connection attempts are reported in auth.log. It might be fail2ban who generated them, while I thought it was dovecot. In iptables, I see a slowly increasing number of packet drops for rule 185.211.245.128/25. Which is what I expect. It seam that fail2ban interfered with iptables, or just that the logging was incorrect. But after 4 hours, and just after posting this update, I got four new connection attempts.



Update4: I made some progress. The login attempts are blocked when the drop rules are put before all allow rule. It looks as if the attacker benefit from other allow rules to circumvent the deny rule. How this is possible is still unclear. If this interpretation is correct, ufw has a hole which is a security problem !



The deny rules, must apparently come first. I can ensure it myself, but a naive use of ufw could expose the host. I would suggest that ufw always insert the deny rules in front of any allow rules as a precaution measure.

macos - VBA Excel 2011 for Mac: Create custom category for user defined function error

I created several functions i.e.: "cal_adval". I would like to add it to a new function category named "Custom Clearance"



I read the documentation, and wrote this macro:



Sub add_category()

Application.MacroOptions Macro:="calc_adval", Category:="Customs Clearance"
Application.MacroOptions Macro:="calc_fodinfa", Category:="Customs Clearance"
Application.MacroOptions Macro:="calc_vat", Category:="Customs Clearance"
Application.MacroOptions Macro:="calc_liquidation", Category:="Customs Clearance"


End Sub


However I got this error: Method MacroOption of application failed. Any suggestions?

backup - Refresh SD Cards for Long term storage for video files?



I have a large collection of video files most of them in mp4 format. I currently store them in SD Cards. Once I finish filling a SD Card I lock it and never use it again unless I need to read the files.



My intention is to be able to read those files in 30 years. I have been researching and it appears that even If I don’t use the card and properly store it some data degradation will occur. Is that right?
I also tried to compare it with other storage Medias but most of the information I have found online don’t come from “official” sources.




There is any way of refreshing the charge in SD cards without copying in and out the information manually or should I replace the cards every five years?


Answer



The question is two years old but still relevant. I've had same problem on archiving an huge image archive. Will answer to the question marked in bold.



No, you don't have to replace the SD cards. You only need to refresh them just plugging them in a device capable of read/write them, and use any tool that reads sectors on disk and rewrite them unchanged. This procedure may be done just once every 4 years, that is shorter than the average life span of stored bits. Manifacturer's quality applies.



As Hennes pointed up, still today year 2016, the best media for long term and untouched storage is magnetic tape. But it suffers from being sensitive to magnetic fields and the fast obsolescence of media readers: after 20 years it may be possible you haven't a working tape reader for your data.



De facto, the actual best long term storage are quality SD cards plus the 4 year refresh. This is good for sensitive/military/strategic archives, because every 4 years you can assess the status-quo of technology and if you decide to move the archival media to another thing, you have commercially available both media readers/writers and transfer data to the new medium without the pain of find any reader for the old one.




Another good practice, is have always at disposal two (or more, depends how much important the data is) copies of the archive, stored in different places, so you can recover data being destroyed by other means than media degrade.



I will not support the use of mechanical drives for long term storage because it is proven a sitting HDD may fail to start again if stored more than one year untouched, on the average. It may fail even sooner.


Process in Windows uses my whole cpu, how to identify


For a while now my windows machine goes into full load using all of my cores (i7-930) for a few seconds, this is quite annoying since it induces fps drops in gaming and general laginess when working.


Is there a log or a tool that can log the cpu usage ? When I try the task manager it just never shows a single process at 100% even when it says 100% cpu usage.


Anyone an idea ?


Answer



Download Process Explorer (A tool like Task Manager but way more powerful).


You can see a list of all the process and their CPU usage, and other useful information (CPU time, CPU history, etc...) for diagnosing many issues with your computer.


Process Explorer main window


Note: As Tom Wijsman pointed out, you must run as with admin privileges to see the processes from all users


Run Process Explorer with admin privileges


After installing Windows 7, CHKDSK has ruined my Windows 10 HDD



Pretty much the title.



I installed Windows 7 Ultimate the other day, after getting bored with Windows 10. I installed Win 7 on a 465 GB HDD, while Win 10 was on a 232 GB HDD, label D:\ .




After Windows 7 rebooted, it ran a CHKDSK and before I could skip it (I wan't paying attention, :/) it ran a CHKDSK on drive D:\ and found 'invalid security ID's.' It took maybe 1/2 hr to complete, and all seemed fine from the Windows 7 POV...



But then I rebooted into 10.



And I couldn't access anything. As soon as I logged in, I got pop-ups saying 'This couldn't be accessed' like Desktop, for example. Every single shortcut wasn't functioning properly, and settings (eg. personalisation) would say 'This doesn't exsist' or something like that.



I saw when it was running CHKDSK it was 'replacing' invalid security ID's with 'deafult' ID's. Would this be a problem?



I then also found out I could copy & paste stuff from drive to drive, but a problem was when I tried to run Steam on 7, as I had Steam linked up to my games on my 2nd drive, it would say 'Disk read error' when trying to start a game from my 10 drive. I was able to copy the 'steam' folder from the Win 10 drive, so I was still able to play CS from Windows 7. I just thought that might be helpful.




BTW, if you were somewhat confused, when I say 7 I mean my Windows 7 drive, and 10 my Windows 10 drive.



Sorry for the long explenation, I just had a lot of things to get out.



Thanks in advance!



horIzoN.



Edit: It has just been pointed out to me that I'm not asking what I want to happen next. I want to fix these 'permissions' errors and get Windows 10 working. Also, just to see if I missed anything, I notced the error also says 'Access is denied' when I just booted into Windows 10. The 'Start Menu' will never pop up as well. I am a full admin.


Answer




One source of the problem is Fast Startup in Windows 10, which is basically a logoff + hibernation.



Windows 7 was unable to recognize that state of the Windows 10 hard disk,
so it just proceeded to destroy it.
Then Windows 10 booted and completed the destruction.



Anyone thinking of dual-booting Windows 7 and 10, should first
Turn Off Fast Startup in Windows 10. Or else.
Even then, one might encounter a situation where each Windows version
will demand on each reboot to chkdsk the disk of the other version,

which is of course risky.



Another problem was using incompatible user accounts, since any account created
by one operating system does not exist in the other, therefore doing
chkdsk with one version on files modified by the other is playing hell
with the security IDs of the files.



The "solution" for the accounts incompatibility problem is to use only
standard user accounts.
A standard account that might be safe to work under is the

hidden built-in elevated Administrator account,
which needs to be enabled. However, Microsoft has good reasons
for hiding that account, mostly for security.



If you do not have a prior disk-image of the Windows 10 disk,
the situation is pretty grim.
The only measure which might return some sanity to the Windows 10 installation
is probably
Repair Install Windows 10 with an In-place Upgrade.
If this does not work, then a full reinstall is required, after formatting the disk.




Dual-booting these two versions of Windows is inherently a risky proposition.
A safer solution would be to use Hyper-V under Windows 10 to create a virtual
machine with Windows 7 installed. This would be much safer than dual-boot.


Thursday, March 26, 2015

boot - Create Windows 10 bootable/installation USB drive

I created Windows 10 installation USB drive using media creation tool provided by MS.
(https://www.microsoft.com/en-us/software-download/windows10/)


At first I thought it was USB bootable and also supports installation, but it was not. It was not bootable.
Can I create a USB drive which is bootable and also I can install Windows 10 from it?


A couple of webpage say that this media creation tool makes bootable and installable USB drive.


1) http://venturebeat.com/2016/01/04/how-to-create-a-bootable-windows-10-usb-flash-drive-2/
2) http://www.redmondpie.com/how-to-create-bootable-windows-10-usb-flash-drive-guide/


But for me, it was NOT bootable.
I checked if it was bootable using this tool.
http://www.thewindowsclub.com/check-if-usb-is-bootable-windows


The computer I tested surely supports USB booting (I tested it with another Windows 7 bootable external HDD)


What's wrong with my Win 10 USB drive?

How to install windows 7 RC from a USB disk?



Can anyone provide detailed steps to install Windows 7 RC from a USB hard disk (rather than a DVD)?


Answer



Creating Bootable Vista / Windows 7 USB Flash Drive


This will walk through the steps to create a bootable USB flash drive for the purpose of installing a Vista or Windows 7 OS. These instructions assume that you have a computer with Windows Vista installed on it.


Required:



  • USB Flash Drive (4GB+)

  • Microsoft OS Disk (Vista / Windows 7)

  • A computer running Vista / Windows 7


Format the Drive


The steps here are to use the command line to format the disk properly using the diskpart utility. (Be warned: this will erase everything on your drive. Be careful.)



  • Plug in your USB Flash Drive

  • Open a command prompt as administrator (Right click on Start > All Programs > Accessories > Command Prompt and select “Run as administrator”

  • Find the drive number of your USB Drive by typing the following into the Command Prompt window:

    • diskpart

    • list disk


  • The number of your USB drive will listed. You’ll need this for the next step. I’ll assume that the USB flash drive is disk 1.

  • Format the drive by typing the next instructions into the same window. Replace the number “1” with the number of your disk below.

    • select disk 1

    • clean

    • create partition primary

    • select partition 1

    • active

    • format fs=NTFS

    • assign

    • exit


  • When that is done you’ll have a formatted USB flash drive ready to be made bootable.


Make the Drive Bootable


Next we’ll use the bootsect utility that comes on the Vista or Windows 7 disk to make the flash drive bootable. In the same command window that you were using in Step 1:



  • Insert your Windows Vista / 7 DVD into your drive.

  • Change directory to the DVD’s boot directory where bootsect lives:

    • d:

    • cd d:\boot


  • Use bootsect to set the USB as a bootable NTFS drive prepared for a Vista/7 image. I’m assuming that your USB flash drive has been labeled disk G:\ by the computer:
    bootsect /nt60 g:

  • You can now close the command prompt window, we’re done here.


Copy the installation DVD to the USB drive


The easiest way is to use Windows explorer to copy all of the files on your DVD on to the formatted flash drive. After you’ve copied all of the files the disk you are ready to go.


Set your BIOS to boot from USB


This is where you’re on your own since every computer is different. Most BIOS’s allow you to hit a key at boot and select a boot option.


UEFI bootable Pendrive of Kali Linux



I have recently downloaded Kali linux 64 bit ISO Version 1.1.0a from this link. I am using Rufus to make a bootable pendrive for UEFI system type(using gpt partition scheme). Unfortunately an error has occurred here is its image:



enter image description here




Here is another link which says that Kali Linux 1.0.8 Released with EFI Boot Support.
So I also downloaded that ISO and tried to make a bootable pendrive using the above mentioned configuration. But the same error occured.



I am stuck at this point . Can anyone please help in solving this error.


Answer



Instead of using Rufus use Win32 Disk Imager to create bootable pen-drive.


macos - Correct location of git on Mac OS X


On Mac OS x 10.6.6 I have git installed in /usr/bin/ I wanted to update the git version however the git installer puts it in /usr/local/git/bin/


I realise I could rearrange to path to point to the local one first, but what I do not get is where the /usr/bin/git version came from.


Could it be part of an xcode install and lastly how would I delete it correctly? I have looked and looked but find nothing, and I didn't install it with ports etc. thanks


Answer



Try pkgutil --file-info /usr/bin/git to see if the system knows where it came from. But my guess is something other than XCode or an Apple package (unless you just installed XCode 4; I have no idea about it) put it there and you should just remove it.


How many cron jobs are too many?

I have a couple of cron jobs for basic maintenance which aren't very resource-intensive.



I also have custom task scheduling (which is just calling a .php file and passing information via GET, ie: cronjob.php?param1=param ...). These can add up pretty quickly.



These just call system commands and run external programs (Nmap is one of them). They usually don't take long either.



Anyway, can anyone tell me, roughly what point is too many? I know it's hard to say since it depends on what job is being run and how often, but at what point does the crontab program start "struggling"? Anyone have any idea?



Thanks.

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...