Sunday, November 30, 2014

web server - Problem with file owner/group

I have files on my website which I need access to files on my server and they also need to be able to be edited by the webserver. Now with my current setup I cant seem to do that.



If the owner/group is imran:imran then I have full access to that file but my webserver cant seem to open/edit those file. Now I was told that I need to match the files owner/group with the ones the webserver uses, I had a look at files that the webserver created and they were nobody:nobody. So I changed my whole public_html owner/group to nobody:nobody because I simply had too many files in the folder which needed to be edited by the webserver and would take too long to change owner one by one. The webserver was able to edit it just fine after changing the owner but then I realized something.. now I cant even view the public_html folder.



Does anyone know whats the correct way to set the owners so that I have access as well as the webserver?



(This is on a WHM/cPanel powered server)

windows xp - Picasa duplicates everything into a `$My Pictures` folder

My parents have a Windows XP laptop running Picasa, Dutch version of both. It's configured to put imported photos in C:\Documents and Settings\user\Mijn documenten\Mijn afbeeldingen, which is Windows XP's default My Pictures folder localized to Dutch. A while back I noticed disk space was going much faster than it should be. Turns out there was a Documents and Settings\user\Mijn documenten\$My Pictures pretty much the same size as the original one. This was well over a year ago.


I figured it to be an internationalization bug, the $My Pictures thing looks like a placeholder that didn't get resolved. I figured it'd get fixed soon. It didn't. I threw out Picasa, tediously cleaned up the mess it left behind and replaced it by Windows Live Photo Gallery.


My parents found WLPG to be unworkable and asked to get Picasa back. I reinstalled it, by now it's at 3.8.0 (build 117.29, 0). Wouldn't you have it, the mystery $My Pictures folder is back, 25GB of disk space has evaporated and it's the same mess it used to be. What's going on here? How do I stop it doing this?


Update


I have used a duplicate file finder that I found in another SU question to create a list of duplicate pictures in the two pictures folders, grepped that into a list of just the dupes in the $My Pictures folder and turned that into a cmd script to delete the lot. This took away 23GB of the 25Gb of that mystery folder. I moved the remaining 2GB into the proper location and deleted $My Pictures. Upon starting Picasa, it didn't immediately return, so that's something. I'll check whether it's returned next time I get the chance.

bootable media - Write iso files to usb sticks with dd


So far I have always succeeded at creating bootable USB, until yesterday. I tried creating a bootable USB for Arch Linux, Chakra OS, and Ubuntu this way:


Locate my USB stick:


lsblk # My drive is in /dev/sdb1

Formatting the USB stick:


sudo umount /dev/sdb1
sudo mkdosfs -F 32 /dev/sdb1

Copying the ISO image:


sudo dd if=archlinux-2014.10.01-dual.iso of=/dev/sdb1 conv=notrunc,noerror bs=4M | md5sum

Problem starts here: the checksum returned by md5sum is different from the original ISO image.
Then when I boot on the newly created bootable USB, I get a message telling there's a missing operating system".


I was told formatting the USB prior to writing the ISO file was non-sense, and that I should use Unetbootin. This tool works but even then, I need to format the USB sticks, otherwise Unetbootin won't detect it. I would like to know how to write ISO files to USB sticks, using dd please. I am confused since all tutorials I can find on the web use dd without any problem.


Answer



You do not need partition table on USB stick. You can simply copy ISO image to the raw device, like


dd if=image.iso of=/dev/sdb

Most BIOS'es will recognize it.


P.S. Why do you expect md5sum of dd output to match the sum of iso image??? dd simply prints the summary of the transfer, and this is what your md5sum will get from the pipe.


linux - How can I fix an inconsistent NTFS file system without Windows?



I have a Dell laptop that came with Windows from the factory. Since then, I have installed Linux and replaced the hard drive with an SSD. The NTFS partition is inconsistent (a result of bad sectors on the HDD) and needs to be fixed, but I cannot boot into Windows to run chkdsk.



How do I fix this problem? Until I do, I cannot move my NTFS partition to expand space on my root filesystem, which is critically low.



EDIT:




All of my partitions were cloned from my dying HDD to my SSD via Clonezilla. There are no bad sectors on the SSD, but the NTFS partition is still in an inconsistent state.


Answer



If the computer has nothing but Linux, you should not be using NTFS. There are no good Linux tools for repairing NTFS damage. (The Linux ntfsfix tool just does some very basic checks and then flags the filesystem as needing more attention from Windows.) Thus, in the long term your goal should be to switch from NTFS to a Linux-native filesystem. In the short term, you should use a Windows emergency disk to repair the filesystem. (Such emergency disks are widely available, but I don't happen to have any URLs handy. Maybe you can find one by searching Microsoft's site.) It's conceivable that you could use ntfsclone to make a backup, too; see the --rescue option in its man page. I've never tried this, though.



Overall, I'd say you should do the following:




  1. Use a Windows emergency disc, ntfsclone, or any other tool necessary to gain access to the partition.

  2. Copy the files from that partition to another disk. You can do this in either Linux or Windows, depending on what's convenient and how you got access to the disk.


  3. Create a Linux-native filesystem (ext2/3/4fs, ReiserFS, XFS, JFS, or maybe even Btrfs) on the partition.

  4. Copy the files back to the original (but freshly-prepared) partition.


Chrome - Are there any keyboard shortcuts to arrange tabs on windows?


Scenario:
I hit CTRL+T to open a new tab, but I don't want it as the right-most tab, I want to slide it a few to the left.


Can I do this using just the keyboard or do I have to use the mouse?


I can't see a shortcut here: Windows keyboard shortcuts - Chrome Help


Something like CTRL+SHIFT+LEFT would work nicely.


Answer



There aren't any built-in, but there are extensions that provides this functionality.


I'm now using this chrome extension (recommended): Rearrange Tabs


You do have to edit the settings by going to chrome://extensions/shortcuts and then changing the values as shown in this screen (if you want to match the Linux shortcuts).


How to customise your shortcuts


Happy days :)




Legacy extension (2015)


This is the original one (not updated since 2015): Keyboard Shortcuts to Reorder Tabs


You need to reload all tabs after installing it or it won't work.


Virtual Win 7 machine irreparable on reboot (with pending Windows updates)


I have a virtual Windows 7 machine running in VMWare Workstation. Every time I reboot, Windows updates are configured and installed, the boot process fails, and finally the system attempts and fails to automatically repair itself. None of the manual "advanced" repair options seems to get past the initial stages, either.


I've tried deleting C:\Windows\winsxs\pending.xml and C:\Windows\winsxs\reboot.xml, but the updates still get installed on reboot. This appears to mean that the files are already installed, so I've tried uninstalling the last several installed updates. Specifically, I uninstalled the top 4 non-.NET updates in the list shown below (in the picture). I suppose I could keep randomly uninstalling these one-at-a-time until my computer successfully reboots, but that's a very slow process.


I don't see any option to cancel or hide pending updates in the Windows Update settings window; when I right-click on an update (whether pending, successful, or failed) the only options are to view details or copy details.


I'm not sure what is causing Windows to fail to boot and attempt the auto-repair process, but it may have something to do with the Windows Embedded Standard 2009 toolkit and its associated updates (all the December roll-ups released thus far, plus the IE8 components). Or it may not; I'm not really sure how to tell, but that's just about the only thing I even have installed on the machine. I suppose it could also be a VMWare Workstation problem.


I tried running the auto-fixer here, but it said no problems were detected.


I also tried the suggestions from Itai and Moab here, to no avail; the gpedit fix didn't change the reboot behavior, and as noted previously, I don't see any option to "hide" these updates (and in any case I believe the guilty files are already installed).


....any ideas? Can pending updates be rolled back? Is there a way to figure out which update is causing the boot process to fail, assuming it's even an update?


enter image description here




This is preventing me from cloning the VM, which would be EXTREMELY helpful for my team at the moment.


I've found that I can "imitate" cloning by simply copying all the files for the machine. This is probably not as robust, and it's not as convenient, but the immediate needs of my team are met.


Answer



Before anything, you should try sfc /scannow when you're in WinPE. This will likely not work if windows updates are causing the issue, so continue below to see alternative steps for windows repair.


Find your Windows 7 disc, and boot into it. Get to the WinPE console within the Windows Installation menus to search for the pending.xml file in your C:\Windows\WinSxS folder. If it exists, try renaming this file. Don't delete it or else your computer may be unusable.


Then type in sfc /scannow at the command line. If this still fails, you may need to use the following syntax instead: SFC /SCANNOW /OFFBOOTDIR=C:\ /OFFWINDIR=C:\Windows


This command may run for a long time, and will spit out a CBS.log file. You may need to stop the scan if it lasts more than 12 hours by using CTRL+C, but this should not harm your Windows installation.


If bootup fails, boot back into WinPE and rename the pending.xml file back to its original file name. If rebooting doesn't work after all of this, then an in-place windows upgrade is likely required. See below for more info:


How do I repair the corrupted files found by sfc /scannow? "Windows Resource Protection found corrupt files but was unable to fix some of them."


filesystems - delete millions of files within a directory

The other day I ran bleachbit on my system. I had enabled wipe disk space option in it. It took several hours and my disk space filled up completely (100GB or so). After waiting forever, I decided to terminate the program and delete the files manually.



Now the problem: I'm not able to delete the files or the directory. I cannot do an ls within the directory. I tried rsync -a --delete, wipe, rm, different combos of find & rm, etc



I followed the instructions here and noticed the "Directory Index Full!" error in my logs as well. rm on a directory with millions of files



I noticed that the stat command returned an unusually large directory size of more than a GB. Usually it's just 4096 or something around tens of thousands.




nameh@labs ~ % stat kGcdTIJ1H1                                                                            
File: ‘kGcdTIJ1H1’
Size: 1065287680 Blocks: 2080744 IO Block: 4096 directory
Device: 24h/36d Inode: 9969665 Links: 2
Access: (0777/drwxrwxrwx) Uid: ( 1000/ nameh) Gid: ( 1000/ nameh)
Access: 2014-10-31 07:43:08.848104623 +0530
Modify: 2014-10-31 07:43:19.727719839 +0530
Change: 2014-10-31 07:43:19.727719839 +0530
Birth: -



The "ONLY" command that so far seems to be able to delete files within this dir is the srm command (secure deletion toolkit by THC). All other commands do not work. srm has been running for 20 hours now and has freed up around 1.1 GB so far. It's running with the least secure mode.



sudo srm -v -rfll kGcdTIJ1H1


Ideas?



edit: My question is "how do I delete the directory quickly?". Like in a few hours or so without having to spend several days to delete the files. rm -rf does nothing.

Just after I ran windows update, Internet Explorer 9 won't open

Just after I ran windows update, Internet Explorer won't open at all. I've ran virus scans (Hitman Pro) 10 plus times and I have installed the latest updates, we still get the same error message and IE won't open and IE11 won’t load


This is the error message


C:\windows\system32\api-ms-win-downlevel-shlwapi- I2-1-0.dll

OUR system -


Windows 7 64 bit operating System
Internet Explorer 9
I have restarted the PC
I have installed the latest updates
I have turned IE off & on several times

Could someone help us fix this issue?

Role of Anti-static wrist wrap, Applying thermal solution , cleaning if spilled , and other necessary precautions, protecting your motherboard


Hello I am a newbie in computer hardware, I am little bit confused on



  • How much Thermal Solution is to be used. Also where to put thermal paste on the heat-sink or processor or on both? I read there are several types of thermal solutions like metal-based, ceramic etc, Which thermal solution is better and why ? .

  • Also i googled and found out that it is dangerous if spilled on your motherboard or inside the processor. What should I do if I ever accidently thermal solution spills ?

  • Will Applying thermal paste lower my CPU temperature, my processor diode-2 (as my software says) is over 100 degree ?

  • What are the other precautions to take when I open my computer cabinet ?

  • Why Do I need to wear a Anti-Static Wrist Band , I have seen many of the people opening their computers without a wrist band

  • Also What is price range of a Anti-static wrist band in Dollars.

  • What will happen if my motherboard touches the cabinet doors ?


Thanks in advance


Answer



Here are some answers:



About anti-static wrist band:



First read this answer. If you are careful and have good operating environment, you don't need it. I've been working with computer insides for over 10 years now and I never had any problems with static electricity.


There are few things to consider: If you often get shocks from static electricity, you'll need to be careful. There are few things that can help you minimize the risk. For example, first find a good clear and clean working surface. Then move the computer case there. Once you get ready to work, touch a metal part of the case while power supply is plugged in. After that, disconnect the power and open the computer. This way any static electricity will be grounded. Avoid moving a lot while working on the computer. Main some of the main sources of static electricity are synthetic carpets and socks, wool sweaters and similar. If you don't move a lot, there will be lover chance that you will create static electricity.


If you do decide to take the "paranoid" way, here's some basic info: You'll need an anti-static wrap with a resistor. Such wraps cost around $7.5 in my country. Your local prices will of course be different, but you now have a reference point for what is expensive and what is not. Another thing which you may find useful is anti-static mat. They are a bit more expensive and cost around $25 here. The point of the mat is to have a safe anti-static work surface. Always remember to connect the wrist wrap and mat ground connector with something grounded! Power plugs in my country have exposed ground connectors, so they are a natural choice. Other good choices are unpainted tubes for water or central heating.





Thermal compounds:



There are endless battles fought around them and best ways of application. Here are some most basic tips: Look for reviews for thermal compound before buying it. Arctic silver 5 and Arctic Cooling MX3 are now considered the best thermal compounds, so make sure to consider them.





About amount:



In general you should place a little as possible. To determine how little is enough, you'll need to practice. Large amounts of thermal compound will have negative effect! So be careful. The right amount should fill the microscopic cavities on the processor and the heatsink. To test if you have enough compound, apply the compound and install the processor and heatsink, then remove the heatsink. There should be thin layer of compound over processor's surface and over heatsink's surface. Important thing to watch out for are bubbles! When you remove the heatsink, the entire surface covered by thermal compound should look disturbed. If it's smooth, it means that you didn't install heatsink correctly or you had bubbles.





Type:



For quite some time the metallic compound were the best. Then came Arctic Cooling MX2 and later MX3 and challenged that. My recommendation is not to pay too much attention type of thermal compound. Read its reviews and see how it compares to other compounds. Also, it is important to know that metallic compound are denser then silicon. When you try to get some Arctic Silver 5 out of the syringe, it may take some time for it to start moving, so don't press to hard or you'll spill a lot. Silicon compounds are much more responsive in that field and are easier to apply. Also it may take some time for metallic compounds to start working with highest efficiency (200 hours for Arctic Silver 5, if I remember correctly) while silicon compounds work their best right away. On the other hand silicon compounds may have to be changed every year because some of them can dry out.


There are several techniques to place the compound and there were many many debates (and flame wars) about the best. I'll explain two here, but first go here and read texts about your processor type there and watch this video and related videos.


One popular way is to take the processor and apply a thin line of thermal compound across the middle processor. Then place the heatsink and press down. The thermal compound will spread and cover the area beneath the cores of the processor. This way, you'll have almost no bubbles, but the compound will not cover the entice contact surface. The argument for this method says that the surface beneath which the heat is produces is covered, so there is no need to cover the rest.


Another way is to use for example credit card or something similar to cover entire surface of the processor with a very thin layer of the compound. Then place a little "dot" on the middle of the processor. After that place the heatsink so that it if at all possible comes into contact with the dot first. The dot will prevent creation of bubbles and entire surface will be covered. Bad side is that it requires some work to get it done correctly and benefits of covering the entire surface are not big.





Cleaning the compound and spills:



Do not be very concerned about the spills. It's not the end of the world if they do happen. In the old days, there were conductive thermal compounds (such as Arctic Silver 3, if I remember correctly) which could cause short-circuits if spilled. Today such compounds are rare even among metallic compounds (Arctic Silver 5 is not a conductor and Arctic Cooling MX3 is silicone based and is insulator). Silicon compounds are basically insulators, so there is no danger in using them.





Cleaning the compounds:



Usually alcohol is used to clean them. In my country we use ethanol, but isopropyl (AKA 2-propanol) is also commonly used. Take a lint-free cloth and apply alcohol and rub the surface. That's the whole magic.


Another option is to use thermal compound cleaners. I had experience with ArctiClean. It isn't as good as advertised, but I was quite happily surprised to find out that advertisements exaggerate by only a little bit. Basically drip some liquid from bottle no.1 and wait for about a minute, then clean the surface with a lint free cloth. It should be much easier to clean comparing to ethanol. Then drip some from bottle no.2 and wait for about a minute and clean with lint-free cloth. ArctiClean should also be capable of preventing corrosion from for example fingerprints which occurs of copper heatsinks and smells better that alcohol.


There should be no way for thermal compound to actually get inside the processor, so don't worry about that danger.





About motherboard touching doors:



You have several questions about motherboard touching the doors and similar, so here's quick guide on how to open the computer case:


First find out how your case is opened. On most cases, there are two doors. When looking from the front of the case, the left door should keep the interesting part of the computer closed. So place the case on the surface with right door facing down and connect the power supply to electricity. Touch a metal part of the case, then disconnect electric cable and press the power button. Now only the computer's clock should be working (It's powered by an internal battery and there is no need to disconnect it while working. If you do, you'll lose all BIOS settings.). Remove the screws holding the left door of the case and remove the door. Inside you will find the motherboard, cards, optical disk drives and so on. If you happen to find a metal plate with crews sticking put of it, you opened the wrong door. Put it back and open the other one.


The only danger which doors represent to motherboard of shut down computer is mechanical damage. If the door touches the motherboard, nothing should happen. Just don't drop the door or other objects inside the computer.


boot - How to make a bootable USB disk for installing Windows 7?


with my new Lenovo E145 I am stuck when it comes to installing a fresh Windows 7/ dual boot device.


The laptop has no CD/DVD drive, and had Windows 7 pre-installed. I downloaded an ISO image X17... and put this image on the USB stick. The stick boots fine, but after pressing "Install Windows" - I end up in an endless loop about missing drivers on the stick.


In the BIOS, I've tried to set the SATA driver to "compatibility" mode already, and everything else to "Legacy" - but no luck. The installation boot ends up asking about drivers.


Researching more, I found some hints on using the Windows Deployment Kit. But it is here, where it gets fuzzy for me. The process refers to making an ISO file with drivers out of the initial Windows 7 CD - which I don't have.


How can I make a bootable USB stick?


screenshot


Answer



Method 1 :


When Windows is asking for driver, just click Cancel. You will be brought back to the welcome screen. At the welcome screen, remove your USB drive, insert it back to DIFFERENT USB PORT. Click Install Now again. The installation process will be like usual.


This problem happened to all new version of updated Windows 7 installer. I think, it is due to failure of Windows installer to remain its detection to the USB drive. It lost the connection, and became confused, don't know where to find the USB drive it used to read before.


When we re-insert the USB drive, Windows installer will detect the USB drive back, and continue like usual.


Method 2 :


If above solution doesn't work
then download the sata driver from here and put in same bootable usb, Press ok in screen, browse and install.


performance - What does high ambient CPU mean?


I have run userbenchmark test, the results are here: http://www.userbenchmark.com/UserRun/357122 According to them, the PC has high ambient CPU.



!!!Very high ambient CPU load. These results have reduced accuracy
because the CPU was active before the benchmark even started. Check
CPU load with windows task manager (CTRL+SHIFT+ESC).



I don't know what that means, and found nothing in google about that. I guess it is high CPU usage when I do nothing. Am I right? I checked, there is no virus in the system according to malwarebytes and eset smart security.


I just changed my Intel Core2 Duo E8400 to a Xeon E5430. The Xeon was designed for 771 socket, not for 775, so I had to use an adapter. Can this cause the problem? Is there a way to fix this?


Answer



The report complains that you already had programs running which used CPU capacity.


This means that the benchmark tool cannot fully outload your CPU because some space is already in-use and thus the test results might differ from what your real CPU might be able to do


The warning message shows because they want to warn you that CPU-related results might be distorted


How does one recover data from a "not initialized" drive that was part of a BitLocker encrypted USB RAID 1 array?

The drive was used inside a CR-H212 external RAID enclosure. The drives were working fine until I did the following:



  • Safely removed (in Windows) and fully unplugged

  • Opened and removed the two drives

  • Switched enclosure to normal mode

  • Put in a different drive and plugged in to see its contents (it was fine)

  • Safely removed (in Windows) and fully unplugged

  • Switched enclosure back to RAID 1 mode

  • Put the original two drives back in

  • When plugged in, now shows as not initialized


After checking the manual again, it does warn about switching modes... I totally forgot! I'm guessing when you switch the mode back to RAID 1, the enclosure thinks you're starting a new array regardless of what is already on the drives. What it writes to disk to get things started I don't know. I know it didn't completely wipe the drives since the lights only blinked a few times and then stopped. In theory the data is still there.


I took the drives out again and connected one directly to SATA in my Linux machine and am dd-ing it to a backup file.


I do have a third drive that I rotated out of the array a while ago and I can access the (outdated) data just fine outside the array. The other drives show as "not initialized" whether they are in the array or not. I tried comparing partition info between the third drive and the not initialized ones (using testdisk) and they seem to be the same (which I guess makes sense) but which data specifies being initialized or not? What else can I compare with and what should I look for?


I was thinking of initializing the array and formatting it to what it was before (NTFS) and then copying the raw data from the backup to the array, but I don't know if that will do the trick. Would I need to copy data from/to a certain offset?

Windows 7 SP1 Windows Update stuck checking for updates


I installed Windows 7 fresh and installed SP1. Now, when I try to check manually for Windows Updates it just hangs on the Checking for updates screen.


Windows Update dialog on hang


I tried running the tools in How do I reset Windows Update components?, but this did not fix the issue either:


No matter what I do it just hangs on the "Checking for updates..." screen and goes no further.


Answer



Fix


Microsoft released a Windows Update Client Update which is part of the July 2016 Update Rollup to fix the long hang at Windows Update scan.



This update contains some improvements to Windows Update Client in
Windows 7 Service Pack 1 (SP1). This includes the following:



  • An optimization that addresses long scan time for updates that's reported on some computers.




  1. Download:



  2. Stop Windows Update service. This speeds up the setup of MSU updates and the useless steps from Moab are not required (reboot causes that the WU service is stopped until it gets started via trigger when Internet is available). This can be done from the command line, or from the Service Manager window.


  3. Try the downloaded update and see if it speeds up the installation of Updates.



To be able to install the update you first need to install the April 2015 servicing stack update for Windows 7 and Windows Server 2008 R2 update (again, stop WU service before trying to install the MSU).


Download (April 2015 servicing stack update):


Workaround 1


If this is still not helping to search for new updates, use WSUSOffline to get all the updates.


linux - Crontab running before nfs mounted



Running Cronjob @reboot returns that file on nfs share does not exist.



Example




@reboot python /abs/path/to/script.py


mail from crontab on startup reads "more or less"



/usr/bin/python can't open file "/abs/path/to/script.py": [Error No. 2] No such file or folder.


Script can be run from the command line with no trouble..
Theory is that the cronjob is running before mount has been run.
The questions.





  1. Is this theory correct?

  2. Is there a way to force the job to wail until the drive has been mounted? .... Other than just putting in a sleep 60 into the command. ;) I tried that already, but it's hit and miss and I need the script to run 100% of the time quickly.


Answer



You can use the mountpoint command to ensure the mount has taken place before you execute your command e.g. (assuming /abs is the mount point)



#!/bin/bash
while true
do

if mountpoint -q /abs
then
/usr/bin/python /abs/path/to/script.py
break
fi
sleep 10
done

Saturday, November 29, 2014

performance - Why won't Windows use the other CPU cores?



In Windows Task Manager the Performance tab shows the first CPU maxed out, the other 7 just idling along with the occasional spike. What gives?



More info:
I've got 8GB and only 4.5GB are being used. The Processes tab has no indication of any process hogging processing power. In fact System Idle Process is 98-99.



When I program stuff and have like 8 to 12 applications going (several directly unrelated to programming of course) my computer slows to a crawl.




System Info:



Intel Core i7-2600K Processor (quad-core with hyper-threading), 
8GB RAM,
Intel BOXDZ68BC LGA 1155 Motherboard,
500GB HDD

Answer



Many apps don't use all cores. They aren't programmed for it. Then they will use one core and will overload it.




But you can tell Windows to run that process on 2,3, ... and in all cores.



For doing it, follow these steps:




  1. Open Task Manager

  2. Select tab Processes

  3. Right click and select 'Set Affinity'

  4. Select on which cores you want to run process.



script - How to add extensions to a lot of files using content of each file?

I've got over 10,000 files that don't have extensions from older versions of the Mac OS. They're extremely nested in file structure, and they also have all sorts of strange formatting and characters. They don't have file types or creator codes attached to them any longer. A lot of these files have text in the file that will let me determine extensions (for example Word.Document.8 is in the text of every file created by that version of Word).


I found a script that looks like it would work for one of these file types at a time, but it erases parts of filenames after nefarious characters, which is not good.


find . -type f -not -name "*.*" -print0 |\
xargs -0 file |\
grep 'Word.Document.8' |\
sed 's/:.*//' |\
xargs -I % echo mv % %.doc

Should I clean the characters in the filenames first, or programmatically deal with those in the script in order to leave them the same? As long as I lose no information from the filenames, I don't see a problem cleaning out slashes and other problem characters. Also, if I clean the filenames, there are likely to be duplicates, so any cleaning script would have to add something like "-1" before the extension to make sure nothing gets lost.


I'm not tied to this script, but it is understandable, which is a pro. Mac OS X 10.6 is installed on this file server, but I've got access to any recent versions of OS X.

download - How do I neatly save a set of webpages?






I have an index webpage, with just one level of links. I want to download all the linked webpages and have them neatly stored on my computer, so clicking the link on the index should open up the respective offline webpage. Is this possible?


Answer



The easiest tool to use is HTTrack, it is a free, fast and an easy to use website copier that is very configurable. You can set links deep and pretty much anything you want.


It will store all the downloaded results in a folder and preserve the directory structure of the server.


You can then either browse offline by double clicking on any file or copy to a webserver and all links will be preserved.


Expectations for NTFS file recovery


Yesterday I booted my XP system, and as I looked up a minute later I saw the light blue screen and tail-end of that pre-boot diskcheck Windows sometimes does if it finds an error (or was previously told to run a diskcheck drung the next boot). I didn't worry about it at the moment...


But then I looked at my "scratch" disk, which was a 70% full, 750GB hard disk...and it now looks like it has been freshly formatted. It doesn't have a single file on it, just the hidden "System Volume Information" file and 750GB of freedom from data.


I looked at some of the recovery tools from the Free NTFS partition recovery question and decided to try PC INSPECTOR™ File Recovery 4.x initially. It ran overnight and afterwards returned a list of thousands of files it could recover. The odd thing was that the filenames were lost, but the file extensions were not (WTF?). And all of the files were exactly 1,472kB in size. I recovered a dozen PDFs as a test, and 80% of them displayed OK despite being padded out to 1.5MB (though I assume any files > 1472kB are hosed).


My primary question is: Is this the best I can expect from any file recovery software when trying to recover NTFS files? Or is there perhaps something better out there? I assume this is as good as it gets, but wanted to check in with the experts first.


Bonus questions:



  1. What might have happened to my
    drive? I didn't intentionally format
    it. I've never seen a disk error
    cause the drive to suddenly become
    a clean, reformatted drive. Could some malicious/confused software have told my PC to format
    my disk on reboot? Is that even a
    function Windows XP has?

  2. Why can the file extensions be recovered but not the filename? Does NTFS really treat them as separate entities? I thought I had 8.3 naming turned off, but maybe that had something to do with it. Or maybe it looks at the data in the file and guesses the extension?


Answer



on a 750Gb drive, GetDataBack will take an age, but is one of the best out there.


a drive i work with recently lost it's entire partition table for no explicable reason. GDB did a pretty good job of recovering it after several other progs failed.


Windows delays writing FAT table on small USB drive despite “Quick removal”


I am seeing delayed writes to the FAT on a small-capacity FAT(FAT12)-formatted USB flash drive even though the policy for the drive is set to "Quick Removal". (I believe this means the SurpriseRemovalOK flag is set). I've captured the SCSI commands sent to the drive over USB: the file truncation writes happen immediately, the entire file (2 512-byte sectors long) is written immediately after that, but then there's a 20-90 second delay before the FAT is updated to reflect the file write.


The size of the drive is significant. I have tested with and see problems on FAT filesystems of size 15MB and smaller. On 16MB and up, the writes are not delayed. 16MB is the breakpoint I see between using FAT12 and FAT16 when I format a drive in Windows. (Note added later: But FAT12/FAT16 breakpoint is dependent on the number of clusters, not the absolute filesystem size).


On 16MB and larger, Windows sends SCSI Prevent/Allow Medium Removal commands before writes, asking that the device not be removed. The USB stick actually returns failure on these requests (because it can't guarantee no removal), but Windows tries anyway. The 15MB and smaller traces show no Prevent/Allow Medium Removal commands.


(I discovered this problem while using a microcontroller board that supports a tiny FAT filesystem containing Python code. When the microcontroller detects a write to the filesystem, it waits a bit for the write to complete and then automatically restarts and runs the newly written Python code. But the microcontroller was seeing corrupted code or a corrupted filesystem due to the delayed write.)


Why is the write to the FAT delayed so long, despite "Quick Removal" being set? I can force the writes by doing an "Eject" on the drive but that defeats the promise of "Quick Removal". If I pulled the drive early it would have an incorrect FAT table. This belies the statement in the screen shot below about not having to use "Safely Remove Hardware". Is this a bug or am I missing something? Is there any way to force all the writes to happen immediately without a manual "Eject"?


USB drive set to Quick Removal


Here's a pruned extract from a Wireshark/USBPcap trace showing the issue. I truncate an existing file and then write a new copy of it. I've added comments with ###. Most of the writes to the USB drive take place around 5 seconds into the trace, but the final FAT write isn't until 26 seconds.


No.    Time  Source       Destination  Protocol  Length  Info
### write directory entry to truncate file
13 5.225586 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x00000041, Len: 8)
14 5.225838 host 1.2.2 USB 4123 URB_BULK out
### write FAT entries to truncate file
16 5.230488 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x0000003b, Len: 1)
17 5.230707 host 1.2.2 USB 539 URB_BULK out
19 5.235110 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x0000003e, Len: 1)
20 5.235329 host 1.2.2 USB 539 URB_BULK out
### write directory entry for
22 5.252672 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x00000041, Len: 8)
23 5.252825 host 1.2.2 USB 4123 URB_BULK out
### write out file data (2 sectors of 512 bytes)
25 5.257416 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x000000c1, Len: 2)
26 5.257572 host 1.2.2 USB 1051 URB_BULK out
### 20 second delay
### finally, write FAT entries to indicate used sectors
79 26.559964 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x0000003b, Len: 1)
80 26.560191 host 1.2.2 USB 539 URB_BULK out
82 26.560834 host 1.2.2 USBMS 58 SCSI: Write(10) LUN: 0x00 (LBA: 0x0000003e, Len: 1)
83 26.560936 host 1.2.2 USB 539 URB_BULK out

I've generated traces like this using a regular flash drive and also with a microcontroller board that emulates a tiny USB MSC drive, on both Windows 7 and windows 10.


Just to be clear, this is a FAT12-formatted drive, just called "FAT" in the Windows formatting tool.


Answer



I may have found the actual Windows driver code that's causing the issue.


MS happens to include the FAT filesystem driver in a package of sample driver code. There are several places in that driver where, if the filesystem is FAT12, the driver will not bother to do something like set the dirty bit (maybe there is none for FAT12) or flush the FAT data.


https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/fastfat/verfysup.c#L774
https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/fastfat/cachesup.c#L1212
and maybe most critically:
https://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/fastfat/cleanup.c#L1101


In the last link, in cleanup.c, the FAT is not flushed if the filesystem is FAT12. I think this may be causing exactly the behavior I see:


    //
// If that worked ok, then see if we should flush the FAT as well.
//
if (NT_SUCCESS(Status) && Fcb && !FatIsFat12( Vcb) &&
FlagOn( Fcb->FcbState, FCB_STATE_FLUSH_FAT)) {
Status = FatFlushFat( IrpContext, Vcb);

Reported to Microsoft in Windows Feedback Hub at https://aka.ms/btvdog (special URL that opens in Feedback Hub).


linux - Make a Bootable USB That Saves a Few Files, Overwrites Local Drive, Restores the Few Files

I have a situation similar to Oli's Question.


What I have are small Ubuntu hosts that perform like kiosks and they need a complete rebuild. The technician will attach a USB keyboard and USB stick. They will boot the USB stick, a task they've done before, and then four tasks will happen.



  1. A few files from the local SSD will be saved to the USB. Can this simply be a different partition on the USB, mounted rw?

  2. The local drive will be completely overwritten with a new image.


    dd if=generic-image of=local-SSD bs=1M


  3. Restore the saved files.


  4. Reboot. The BIOS/uEFI boot order lists the local SSD first, so it won't boot from the USB.


The kiosks only have one 32 GB SSD, so my image will be around 32 GB in size. Boot order lists the local SSD first. If these devices are connected to a network, it can be unreliable, so Internet downloads aren't an option.


I can make a bootable USB, but where do I go from there? Modify some GRUB line to run a special script? (This seems simplest, but how?) Modify some systemd service to run once? (How?) Force Anaconda to use a simple ks.cfg that only uses %pre and %post without any %package? (How would I setup Anaconda? I've done kickstart files before, but never with no %package section.)


In the MS-DOS days, I'd have a bootable floppy disk and modify autoexec.bat to do tasks 1, 2, and 3. This can't be that hard with all the Linux tools at my disposal.

Avoid alphabetical reading of Windows environment variables



Normally, if I define one User Windows 10 environment variable (var 1) in terms of another (var 2), var 2 should precede var 1 in alphabetical order for it to work.
This is identified here, e.g.




For instance, in the window



enter image description here



this



APYTHONDIR  ->  C:\Users\user1\myprogs
PATH -> %APYTHONDIR%



works, but this



PYTHONDIR  ->  C:\Users\user1\myprogs
PATH -> %PYTHONDIR%


does not.



Is there any way of avoiding it?
Working around it?




I mean to get a solution that functionally works the same as if the variables were defined via registry (or Control Panel).



I can always use naming to ensure "nested" definitions follow alphabetical order.
This is not what I want.



I thought about setting them in the desired order in a startup batch file (autoexec.nt, or whatever is current).
I am not sure if this would work for any application requiring the environment variables.
E.g., octave symbolic integration needing to find python somewhere in the PATH, with the directory in the PATH being added in this way.




EDIT As per the answers by harrymc and myself, and following discussion, this is what I tried:




  1. Creating a file set_env_vars.bat in an arbitrary directory, and set a shortcut to it in %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.


  2. Adding a line set /P PTEST=Enter value for PTEST in set_env_vars.bat to make sure the file is being read during logon.


  3. Logging off and on. I verified that set_env_vars.bat is read.




Then, I added lines




set ZTEST_DIR=C:\ztest
set YTEST_DIR=%ZTEST_DIR%;C:\ytest


to set_env_vars.bat.
Plus log off / log on.
This didn't give me vars ZTEST_DIR and YTEST_DIR in my environment.



Then, I replaced those with lines




setx ZTEST_DIR C:\ztest
set /P WAITING_DUMMY=Enter value for WAITING_DUMMY
setx YTEST_DIR %ZTEST_DIR%;C:\ytest


in set_env_vars.bat.
(The second line to try giving time to the system to set the first var).
Plus log off / log on.
This gave me vars




YTEST_DIR=;C:\ytest
ZTEST_DIR=C:\ztest


in my environment.


Answer



In summary:




  1. Setup file setvars.cmd (the name is arbitrary) in directory %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, or put setvars.cmd elsewhere and set a shortcut to it from there.



  2. In that file, use (e.g.)



    setx DIR2 C:\dir2
    set DIR2=C:\dir2
    setx DIR1 %DIR2%;C:\dir1
    set DIR1=%DIR2%;C:\dir1



Tested and it works.






tl;dr

There seem to be at least 3 alternative ways to define user environment variables:




  1. Via Control Panel.

    Right-click computer -> Properties -> Advanced system settings -> Environment Variables -> New for User variables for USER1 -> Type in Name and Value for the variable -> Ok.

    "Nested" usage of variables is read in alphabetical order.


    Variables are also displayed in alphabetical order.


  2. Via registry editing of HKEY_CURRENT_USER\Environment.

    Windows key -> reged -> Goto HKEY_CURRENT_USER\Environment in the address bar -> Edit -> New -> REG_EXPAND_SZ -> Type Name -> Right click on added name -> Modify -> Type Value -> Ok.

    "Nested" usage of variables is read in the order they were defined.

    Variables are displayed in alphabetical order, only for convenience.

    This answers the question, in principle. But if "nested" definitions that do not follow alphabetical order were used, one is "banned" from using the Control Panel method ever again, otherwise it enforces alphabetical order reading and messes up the definitions.


  3. Via command line / batch file / autoexec.

    As detailed below.
    Helped by this answer, with the added use of SETX var value instead of only SET var=value.

    "Nested" usage of variables is read in the order they were defined.


    And with proper automation, this is done at each logon, so using the Control Panel way would only possibly mess up "nested" definitions for the current session. This is probably the best combination.




Note that to avoid having to log off to reread variables, one can use this, or refreshenv.



Detail of method 3:
The proper way of achieving the objective of the OP (get a solution that functionally works the same as if the variables were defined via registry (or Control Panel), but avoiding alphabetical ordering) is:




  1. Using a .bat (or, better, a .cmd) file, read during logon (method 3), say, setvars.cmd.



  2. In that file, using setx to set environment variables at the registry level (e.g., var2).
    This does not update the local environment.


  3. To be able to use "nested" variable definitions that endure for the windows session (e.g., var1 in terms of the value of var2), one needs var2 to be also defined in the process spawned by setvars.cmd. According to item 2 above, this is not accomplished by setx.
    For that, one would add a set line corresponding to each setx line.
    With this, the same environment is obtained in the registry and in the local process.
    Alternatively, one may try using REG query HKCU\Environment /V ... chained with other commands (as used, e.g., in refreshenv), but I did not pursue this.
    If the Control Panel way is ever used, it can mess up nested definitions that do not follow alphabetical order. This can be overcome by simply executing again setvars.cmd.



Hard drive not found


I have a dell 1525 which has stopped booting.


It instead makes a high pitched intermittent whir and say "internal hard drive not found", I'm not particularly hardware smart...


How can I solve this issue?


Answer



Best bet is to log a support ticket with Dell - there are a few possible causes.


If you are happy with taking it to pieces, you can check the cables are correctly seated (give the cable to the hard drive a push into the socket at each end) but most likely is that the hard drive has died - in which case you'll need a new one.


load balancing - Question regarding uptime strategy for website



I'm working on a website where we need to have a good deal of uptime. Specially in the short bursts (15-day periods) that the website's events happen.



The page is dead simple and can be served almost completely off an html cache. While there is a php based part, this is not mission critical and in case of failure, we can live with the cache for a say 20 minutes until the eventual problem is sorted out. More than 20 minutes won't really work as the site hosts a live score board among other things.



We had successful deployments in Amazon using multiple EC2 with elastic load balancing and also using the Rackspace cloud (Cloud Sites and Cloud Servers).




For this particular website we'd like to have the app running in these two providers at the same time but just serve the pages from off one of them. In case the main provider fails just move to the other and keep going.



I know how to make everything work in just one provider. What I'm not clear on how to achieve is the actual switch from one provider to the other. For example, if I CNAME myapp.com to a domain in Rackspace and it fails, when I change the CNAME to point to Amazon, a great deal of users will aready have their DNS cached to Rackspace and the whole thing would be pointless... this is one of the many questions that I have...



Any help is greatly appreciated... tips, advise, gotchas, anything is welcome...


Answer



I would think that either Amazon or Rackspace alone should give you the uptime that you require. The whole point of the cloud is that you already have a high availability situation. If your Amazon or Rackspace hardware fails your image is restarted on other hardware. Have you already had an uptime problem or are you trying to solve an issue that hasn't yet occured?



If you have massive surges of traffic, and a lot of static content I think you should consider a CDN. Edgecast has reasonable prices and an excellent network. All your static content could get served from their geo redundant servers and help you with site availability.


Asus n53sv (preinstalled Windows + recovery partition) - HDD broken, how to get Windows 7?

My HDD broken in Asus n53sv, I bought new one. I dont have Win7 installation DVD I only have product key on back side of my Asus. I could download Win7 iso installation DVD, install it and provide this key, would it work?


If yes - I dont have DVD room, but I have USB case for SATA drives. Could I install it to USB using WinToUSB and after installing iso to this USB could I connect the drive to SATA slot? Would it boot ?

Apache: Multiple Virtual Hosts w/ SSL Certificates?



I have an Ubuntu 11.04 Server with multiple Virtual Hosts running on a shared IP. Is it possible to have two (different) SSL certificates for each site?



I remember hearing something about you only being able have one SSL certificate per IP.


Answer



You can host multiple SSL based sites. You have to use SNI, and not all browsers support SNI, so you can have issues with an older web browser. Most modern browsers should support it. It's described in RFC-6066




This HOW-TO can walk you though how to do it.


windows 10 - Stop Feature upgrades and properly manage them via WSUS

In the last few months, systems have been randomly upgrading themselves, the update is not approved within WSUS and is obtained directly from Miccrosoft Servers.



The upgrade to 1709/1703 is not managed by WSUS and needs to be controlled. And the upgrade to the next feature update needs to be properly executed across the business the miniseries any downtime.



Configuring "Defer Feature Upgrades" GPO stopped the direct upgrade to build 1709 - but not the upgrade to 1703 because...



"Now that Microsoft, uh, recommends version 1703 build 15063.483, your “Defer feature updates” setting has expired, and you’re getting the business-ready version of Win10 Creators Update. (This, despite the fact that there’s a massive batch of bug fixes waiting in the wings for 1703.)
There is no "Current Branch for Business" anymore, but that "Microsoft recommends" bullet applies in its stead. If you were deferring updates, your deferral just ran out (see screenshot)."
- this is news to me!



Source: https://www.computerworld.com/article/3211375/microsoft-windows/win10-machines-with-defer-feature-up....




This is my current Windows Update Configuration under:



DeferQualityUpdates   REG_DWORD   0x0             (not enabled)
DeferFeatureUpdates REG_DWORD 0x1         (enabled)
BranchReadinessLevel REG_DWORD 0x20        (set to current branch for business)
DeferFeatureUpdatesPeriodInDays REG_DWORD 0xb4  (180 days)
ElevateNonAdmins REG_DWORD 0x0          (Users in the Users security group are allowed to approve or disapprove update )
WUServer REG_SZ http://WSUS:8530          (Specified intranet source)
WUStatusServer REG_SZ http://WSUS:8530



The upgrade to 1703 is not managed by WSUS and needs to be controlled. And the upgrade to the next feature update needs to be properly executed across the business the miniseries any downtime.



Is there a way to?




  • Identify what servers a systems connects to when pulling the feature
    update and block communications? (i.e. Stop connections to Microsoft
    Servers through endpoint content control or Boundary Firewall -

    without effecting Office 365 updates)



What I've done so far




  • Understood 1703 is now recommended for business (but I still don't
    want it)


  • Attempted to configure "Do not connect to any Windows Update Internet
    Locations" local GPO, but it blocked access to WSUS too, despite the

    following note: This policy applies only when this PC is configured
    to connect to an intranet update service using the "Specify intranet
    Microsoft update service location" policy - this is already
    configured on a Group Policy level but it's being ignored


  • Considered blacklisting the following application/files on endpoint
    management console to prevent the Windows upgrade assistant from
    running - but haven't had time to test:



    C:\Windows10Upgrade


windows - Hard drive options for home media server


I have a home server, with the following:


My goal is to add drives to the server as needed to increase available space. When my case reaches its drive capacity, I will replace the smaller drives with new, larger drives. For instance, suppose my case had four drive bays. In order to add a new, 3TB drive, I'd need to replace one of the 1TB drives with the 3TB.


My ideal end state is:



  • Ability to add additional drives

  • Ability to replace smaller drives with larger drives

  • Fault tolerance

  • As little proprietary technology as possible


I am currently using windows spanned volumes, but I do not know how well it will work when I want to replace a smaller drive.


Any suggestions?


Answer




  • RAID is not a backup (so take a backup)

  • 2TB and larger drives have much higher failure rates than 1TB

  • you don't really want anything larger than 4x2TB in RAID5 because chances of a 2nd drive failure during a rebuild become quite high. (More drives is much better than larger drives)

  • RAID1 from one hardware device can usually be moved straight to another and if not splitting it gives you the data on a single drive

  • Hardware RAID reduces IO over software RAID so choose it where available

  • RAID can put more stress on drives especially when left running 24/7. Consider Enterprise/RAID versions


So in summary. Larger drives increase your chances of data loss so make good backups/don't expand too quickly. RAID1 is a good compromise of portability and safety. RAID5 is OK but reaching the end of it's usefulness.


Spanned volumes have no fault tolerance and if one of your drives fails you will lose the whole lot of data. These should only be used where you need particularly speedy access and can afford to lose the data. If you are using windows for RAID you really want to be using mirrored volumes.


windows 7 - Win7 admin disabled, had a password, cannot enable

I enabled the administrator user, then put a password on it, then disabled it! And the other user is a standard one. How can I enabled my administrator account again?

Windows 10 high memory usage when screen is off


I upgraded my laptop a few days ago to Windows 10. I have my power plans set in such a way that my screens turn off after a few minutes if there is no activity (I have a secondary screen hooked up to my laptop).
Ever since I upgraded, when I return to my laptop after a period of inactivity and wake up my screens, they wake up very slowly and I get a warning that Windows is running low on memory.


I already tried letting my monitors turn off with task manager open to see which process is taking up much memory. It appears that the "System" process uses up to 1GB of memory when the screen is off, which is a lot when having 4 GB in total. When the screens are back on again it stays at around 1 GB for around a minute and then drops back to normal levels of around 200 MB.


I did not have this problem when running Windows 8.1, so it leads me to believe it is related to the upgrade. I already looked at the suggestion for this question to use poolmon to look for a driver issue. From this it appeared that the problem may be related to the ReadyBoost driver, but I am not entirely sure.


The memory usage is fine under normal operation, or when I turn off the screens for a brief moment. It only seems to spike upon turning off my screens for a longer period of time.


Is anyone familiar with this issue, or perhaps know how to reduce RAM usage when my screens are turned off?


Answer



After trying out a lot of different settings and configurations, it appears the problem is related to the settings of my secondary monitor.


The monitor has three different video inputs (VGA, DVI and HDMI) and it was set to automatically detect the correct input, based on which is connected. Since I only use HDMI, I have changed the input detection to “manual” and set it to HDMI. I do no longer run out of memory now.


It is remarkable though that I did not have this problem on Windows 7 and Windows 8.1, but I do have it on Windows 10.


SSL,IIS: One website for multiple sub-domains and one website for the top-level domain (with or without www.))

I have multiple sub domains that should point to the same website and the top-level domain should point to another website. All of these are under SSL. For example:




abc.mydomain.com ---> Website A,
def.mydomain.com ---> Website A,
ghi.mydomain.com ---> Website A,
jkl.mydomain.com ---> Website A

mydomain.com ---> Website B,

www.mydomain.com ---> Website B


I have already purchased a wildcard ssl certificate and a dedicated IP. Can both websites share the same IP or should each one have its own IP?



I don't need wildcard host headers or wildcard DNS mapping. Every time, for each new sub-domain I am able to add a new DNS record and a new host header for the Website A.

chromium - How to stop web site navigation hover pop-ups in browser

I've run into an annoying type of pop-up and can't figure out how to suppress it. The problem is links at certain sites related to web site navigation that activate when you hover on them. It happens with all browsers. I don't recall this behavior previously, but I'm suddenly running into it with multiple browsers and multiple sites.



The amazon.com and walmart.com sites are at least two where I'm running into this. On both, there is a row of shopping "helper" links (circled in the pictures below), near the top of product pages. These are site navigation menus. If you click on one of those links, it takes you to a dedicated page.



But there's a hover "feature". If you hover the mouse over most of these links, it pops up a window with a menu of links, an abbreviated version of the "click-on" page. That window covers a large portion of the screen, and remains displayed as long as the mouse is over any portion of the pop-up window. There are other similar "hover booby traps" scattered throughout the page.



The Problem




The problem is that there is no hover delay, so merely passing over one of these links is treated as a hover. Accidentally passing over anything in this mine field suddenly obscures the page with a giant navigation menu (or other content), that continues to block the page until the mouse cursor is moved outside of that window. Even worse, I sometimes find myself on a new page related to some garbage in the pop-up window.



My main browser is Firefox (V62), but I've replicated it with Chromium and Vivaldi, in both Windows 7 and Linux, as well as Internet Explorer in Windows. Daniel B commented that he also replicated it with Edge. (Earlier, it appeared that the Microsoft browsers behaved differently, but that turns out not to be the case.)



Questions:




  • Can the pop-up mechanism that is employed be easily determined from the web page source code for the example links provided below?

  • Is there a way to suppress this action in Firefox or a Chromium-based browser?




Update



@Kinnectus commented that Javascript is likely used to show/hide the "pop-up" content. I disabled Javascript on those pages and that is the mechanism. Unfortunately disabling Javascript also kills other important functionality on the page. So the mechanism has been confirmed, but any solution would need to be more surgical than disabling Javascript.










How to reproduce



I've discovered that reproducing the problem isn't as straightforward as I thought. The web sites appear to tailor the content based on your prior history on the site, whether you're logged into the site, and even the route used to navigate to the product page (likely the source of earlier confusion in replicating the symptoms).



I'll provide a specific link for each site as an example, but the variation may limit some reader's ability to answer. For example, I tested the direct links below on my wife's computer and got different page features before noticing that the site had "remembered" her, and automatically logged her in. The screens changed when I logged her out.



Here is a product page at walmart.com, with the shopping helper row circled:



enter image description here




Hovering or passing over one of the circled links:



enter image description here



Here is a product page at amazon.com with the shopping helper row circled:



enter image description here



Hovering or passing over one of the circled links:




enter image description here



On all product pages at Amazon, regardless of route, the Account & Lists link in the upper right exhibits the hover action, but I can't be sure it is the same mechanism.









Research




Researching this, I haven't found online discussion about this problem with navigation menus (but it does seem to be very recent, which may also be indicated by the fact that going to a product page via an old bookmark or history link often doesn't exhibit the symptom, but getting to the same page via a fresh search does). There is, however, discussion related to pop-ups of other kinds, with solutions such as:




  • Changing the mouse characteristics, like MouseHoverTime. However, I don't want to degrade performance on legitimate hover options, like tooltips. Even if that is actually a solution, MouseHoverTime is a Windows registry setting, and I'm not aware of an equivalent setting in Linux.

  • Blocking pop-ups. These are part of the site navigation, and not the kind of thing blockers focus on. I have the highest-rated pop-up and ad blockers installed and they don't affect it.



    I installed Poper Blocker, which can also block overlays. It didn't detect these on its own, and navigating to the context menu was treated as navigating off the window, so there wasn't a way to get Poper Blocker to check while the window was present. This doesn't definitively rule out overlays, but Poper Blocker is the only add-on I'm aware of that blocks them, so either way, this doesn't lead to a solution.


  • Blocking specific URLs. These pop-ups aren't URLs.

  • This question on the Mozilla support forum is about URL pop-ups, but the accepted answer discusses some changes in Firefox V61 that can be fixed by modifying userChrome.css. I have no idea whether that's related, and it wouldn't explain the similar problem with Chromium-based and Microsoft browsers. I'm also not a programmer, so even if that is a solution, it wasn't helpful to me.

  • I've verified that triggering by passing over is not a browser malfunction due to add-ons.


Friday, November 28, 2014

unix - sendmail - DSN: Name Server host not found

I've recently setup a new backup server and have configured sendmail with a smart_relay_host



Except every email from the command line doesn't go anywhere. From mail.log:



Oct 3 14:32:52 *****back01 sm-mta[16570]: p93DWqtC016568: to=<.@***.com>, ctladdr= (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120762, relay=10.2.30.60, dsn=5.1.2, stat=Host unknown (Name server: 10.2.30.60: host not found)
Oct 3 14:32:52 *****back01 sm-mta[16570]: p93DWqtC016568: p93DWqtC016570: DSN: Host unknown (Name server: 10.2.30.60: host not found)



DNS is working correctly on this box. I can do forward and reverse lookups.




I can also telnet to the mail relay and send a message that way.



I'm stumped, any suggestions?

windows - Is it possible to safely contain a virus - not letting it spread?




I need to run a program, but I don't trust the author. I think it is infected with spyware, viruses, or malicious files. I scanned it and didn't find anything, but I'm still not feeling good about it.



So I was thinking to create another Windows user account.




  • Will viruses on one account infect the second account? Do I have to scan both user accounts?

  • And if I removed the account infected, will viruses be removed from the PC?



If that won't work then:





  • Is there any "sandbox" to do some testing and insure that you're PC
    is safe?

  • Is Virtualbox an option?



I have Windows 7.


Answer



Use Sandboxie. You can get it at sandboxie.com




Using another account will only help if you set the account as limited and the program you're trying to run doesn't request privilege escalation. Running your program in a sandbox like Sandboxie is much safer and easier.


amd radeon - Can I delete amdkmpfd.ini package in Windows 10?

I am having a dell-inspiron-15r-7520(SE) Laptop.
The laptop is currently running Windows 10 Version 1511 OS Build 10586.1176.
The laptop comes with AMD Radeon HD 7730M discrete graphics card.


My problem is I cant Update my laptop to newer version as Update fails cause of AMD Radeon Driver.


I have disabled installation of Device & driver from multiple places including
"Group Policy" & "Registry", post which I Disabled & Uninstalled the device & driver respectively.
But on the next reboot the device get re-installed.
So I downloaded RAPR.exe and checked that even after Un-Installing everything still one package remains amdkmpfd.ini.
I think this is the local package through which the System is able to recognize & re-install the device.


PS:-
I have already tried updating the driver to latest version but it didn't work,
Treid downloading the latest Drivers directly from AMD site but even it didn't work in both the cases Windows Update fails.


So my question is What if I remove the amdkmpfd.ini package?
Will my system become unstable cause I think its related to "Amdkmpfd.sys" which acts as a filter driver for the installed graphics card.


Link :- http://www.freefixer.com/library/file/amdkmpfd.sys-90599/

Windows 10 Creators Update - Random hangs/freezes

I upgraded my 6700K/GTX 1070 laptop to the Creators Update. All went fine...



But... every now and then (1-2hr) my system will hang for about 30-40 seconds and then returns to normal. No input or display refreshes happen until the freeze concludes. After the freeze, the system "catches up" with itself and uses the input that was previously ignored.



I tried a repair install with no luck.




Here's is a link to my WPA report:
https://www.dropbox.com/s/k4qr85xf84t2lqe/myTrace.zip?dl=0

Ideal permissions scheme for multiple Apache/PHP sites

I'm hosting multiple sites from one server where each site has it's own user and www directory in their home dir. Currently our web server runs as user nobody(99). We're noticing that to run several popular scripts and engines, they require write access to their own files.



As the home directory is owned by the user, not nobody(99), what is the best policy or change in hosting configuration that would:




  • ...make it so that all the various engines and platforms work?

  • ...still allow us to work with files and edit them without having to diddle with permissions as root?

  • Doesn't require me to massage permissions and/or ownership with every file change.




Thanks for the advice!

How to create new user and set the privilege for this account on windows 8



How to create new user and set the privilege for this account on windows 8?



Since 3 of my family share the same computer, and I hope I could keep their privacy from each other.




How can I do that?


Answer



The short version:




  • Start, Settings, Users, Add a user

  • Check "This is a child's account"









To create a new user, open Start and search for Users under Settings.



enter image description here



This should open up to the PC settings page on the Users tab



enter image description here







Add another user



Select Add user under Other Users



enter image description here



Complete the Add a user wizard. There should be an option to set up family safety, but if you miss it our it doesn't show simply:









Once you've finished adding the new user, open Start and search for Change account type
enter image description here







Select the user you would like to change



Click on the account you would like to modify



enter image description here



Change account type



Then select Change account type and choose 'Standard'.
enter image description here







Manage another account



You should return to the following screen, select Manage another account.
enter image description here






Now choose Set up Family Safety and configure appropriately.



enter image description here


Windows 10 Cumulative Updates Failing (On Computer with SSD System Drive + HDD)


I have been having issues with Windows 10's cumulative updates failing for a couple of weeks now. I've tried running SFC /scannow, I've tried running using DISM to replace corrupted system files, I've tried downloading the update and running it manually, I've tried running an in-place upgrade (Windows 10 Pro x64 to Windows 10 x64 upgrade, so wouldn't lose programs or settings) (which failed, by the way), and I don't even remember what all else I've tried, all to no avail. There doesn't appear to be an answer to my specific problem anywhere on the internet.


My computer is running Windows 10 Pro 64-bit.


I am also running a solid-state drive (system drive) and a hard drive. I've got the folders inside C:\Users linked to a location on the HDD with directory junctions to save space on the SSD.


Answer



The reason for this is that for some reason the update has to copy files to one of those folders that is symlinked, and is unable to do so. It is looked at %systemdrive%\Users[whateverfolderhere] and is for some reason unable to move the file to where the Directory Junction is pointing.


In order to fix this problem, following these steps:



  1. Open regedit (press Windows Key + R, and type "regedit)".

  2. Browse to HKLM\Software\Microsoft\WindowsNT\CurrentVersion\ProfileList.

  3. On the right, there are keys with "Data" values pointing to where different Profile folders are located. It should look something like this:
    enter image description here

  4. Change "%SystemDrive%" under "Default," "ProfilesDirectory," and "Public" to the correct drive letter (the drive letter for the HDD). In my case, this is drive D:
    enter image description here

  5. Restart your computer and try installing the updates again.


Just remember to change this if you ever change drive letters!


centos - How configure networking knowing the MAC but not device name?



Background:



I intend to use Kickstart to automate the deployment/configuration of CentOS 7.



I am trying to generate an appropriate Kickstart file to pre-configure networking for the operating system, using a basic configuration file from a sample install of the operating system as a reference point.




I am not clear about how the network interface names are constructed, which poses a problem; I need to know what the interface name is/will be on deployment, so I can configure the network settings such as IP address/gateway/subnet mask, etc.



I do however have access to the MAC address information for each of the network cards on the hosts which will have the operating system deployed to them.



Question:



Do I have enough information to predict the network interface name and/or is there another approach I should consider?


Answer



OK, so if I interpreted your question correctly, you have a couple of things here to think about.




Firstly: it seems that you are being confused by the new network interface naming nomenclature introduced in CentOS 7. In theory, this nomenclature is actually more predictable than the previous one (just a bit less intuitive/readable).



The naming works as follows (from the Red Hat documentation):



 Two character prefixes based on the type of interface:
en -- ethernet
sl -- serial line IP (slip)
wl -- wlan
ww -- wwan


Type of names:
b -- BCMA bus core number
ccw -- CCW bus group name
o -- on-board device index number
s[f][d] -- hotplug slot index number
x -- MAC address
[P]ps[f][d]
-- PCI geographical location
[P]ps[f][u][..][i]

-- USB port number chain


So, you should actually be able to predict the interface name based on knowledge of the board (or to be more basic - if you're using the same board every time, you could just deploy once and see what the interface(s) in question are named to, and use that.



Secondly, you can actually disable this new nomenclature if you so choose, which is actually something which has been covered before in this context here on SF:




You may use the bootloader section in the kickstart file to suppress
predictable network interface names.




Adding net.ifnames=0 and [if needed] biosdevname=0 to the --append
should do what you're asking.




bootloader --location=mbr --append="net.ifnames=0 biosdevname=0"


However, this is of course just a workaround - it might be a good opportunity to take this prompt to just familiarise yourself with the new nomenclature and how it works.


linux - Search through tar files for a pattern and print the full path of what's found

I have directory tree with many tar files. Each tar file contains many other files. I want to search through all the tar files for a given pattern, and print the full path of any files within a tar that are found.


I got this far:
find . -type f -name '*.tar' -exec tar tf {} \; | egrep ''


Now my problem is that the above command only prints the name of the file within the tar that it finds. Ie, the output of the above is:
pattern.jpg
foundMe.txt


I would like the output to contain also the full path and the tar name where the file was found. How would I do this?


Thank you!

My windows directory is huge

I have always had problems with my windows directory's growing to a huge size. It started with windows 95 then 98 then 2000 and xp. Windows 7 however is absolutely huge. The windows folder itself with out program files is 21.4 gigs...add the program files and other windows files and it is a whopping 32 gigs. My question is why is it so large and what can I do about it. At the rate this is going I will be out of space in now time.

System repair disc for windows 8


Recently, I got a new Surface Pro, and I am creating a system image and a system repair disk to prevent an unexpected crash.


I have a system repair disc created from windows 7. Can I use it for windows 8?


Answer



No, you can only use the repair disk which matches to the current Windows version. If you use a Win7 DVD to restore Win8 or Win8 DVD to restore Win7 you get an error message.


I tried this out last year.


Thursday, November 27, 2014

splunk - Weird DF ourput in Red Hat 5.4 - Used < Size, but 0 available?



I have a server with two LUN's mounted from a local SAN. I have a configuration file in place for the vendor software we're using (splunk) that defined the size of the second LUN, but I had accidentally configured it as 6GB larger than it actually was. This morning I came in to see whistles going off about the error. It has been fixed, and the Splunk server process has been restarted to make use of it. It should be clearing out data, and it appears to be doing so. However When i look at the output of DF, I see something weird:




Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p3 507G 4.0G 477G 1% /
/dev/cciss/c0d0p1 97M 19M 73M 21% /boot
tmpfs 36G 0 36G 0% /dev/shm
/dev/mapper/hot_group-lvol0
148G 128G 14G 91% /splunk/hot
/dev/mapper/cold_group-lvol0
837G 797G 0 100% /splunk/cold



As you can see DF is showing that the total size of the disk is significantly larger (40GB than the used disk. However it still shows 0 bytes available. Can anyone explain this?


Answer



That space is reserved for use by root. You can adjust the size of the reserved area using tune2fs /dev/mapper/cold_group-lvol0 -m 1 (assuming it's ext2/3/4) to set it to 1% instead of the default 5%. I think the filesystem needs to be unmounted in order to change it.


Override Expires header for proxied content in Apache

I am serving proxied content with Apache that already contains an Expires header. Using mod_expires' ExpireDefault to override the already present Expires header does not work, the old header is left untouched.



Is there another way to override the Expires header? I tried using mod_headers, but it seems I cannot do date calculation there. I also must override the Expires header, I cannot use Cache-Control with max-age for this.



Regards,
Jochen

reinstall - How to tell if a Windows 7 re-install disk (and subsequent installation) is OEM or not?


How do I tell if a Windows 7 re-install disk is OEM (and subsequent installation) or not?


Can I explore the disk to look for a certain file or setting. And once installed can I go into the control panel and look for an indication or run a utility to detect?


Background


I have a HP laptop which does not come with a full true Windows 7 install disk, instead it comes with recovery disk(s) and partition (i.e. a image of the hard drive partition at factory install).


At some point I would prefer to wipe the laptop disk and re-install cleanly on same laptop Windows 7 from a true Windows 7 OS (re)install disk, available on ebay, and use the genuine COA product serial license key from the label on the laptop. Reason for re-install is to get rid of all the guff (trialware, utils, etc) provided as standard. I would download necessary drivers from online.


I would prefer to obtain a Windows 7 re-install disk that is not OEM. This would be handy for use on other machines later (which have their own genuine COA), hence the preference as OEM is locked to motherboard hardware. I will be looking for an install that matches the Windows 7 edition on the laptop, i.e. 64bit home premium.


Answer



Regular Windows 7 setup disks will accept OEM product keys. I've done this so many times. . .


It's not like under XP/Server 2003.


http://h30434.www3.hp.com/t5/Desktop-Operating-systems-and/The-Cleanest-Install-Windows-7-Recovery-Discs/td-p/394461



You cannot do it with Recovery discs from HP, you could however use a
standard W7 install disc, then download and install software and
drivers using this page, Select Software and Drivers Downloads
http://h10025.www1.hp.com/ewfrf/wc/product?product=4041797&lc=en&cc=us&dlc=en&lang=en&cc=us
W7 ISO downloads here
http://www.mydigitallife.info/2010/04/28/download-windows-7-iso-official-32-bit-and-64-bit-direct-do...



Just in case you need proof.


Ubuntu virtual memory caches suck up memory

I've got an Ubuntu 9.10 64-bit server that seems to use up all available memory. According to my munin graphs, almost all of the memory used up is in the swap cache, cache, and slab cache. (I take this to mean virtual memory caches, am I right in assuming this?)



Once memory usage approaches 100%, some (although not all) system services such as SSH become sluggish and unresponsive. After rebooting the system, performance and memory usage become normal for a time.



Some interesting tidbits:




  • The system runs Apache 2, MySQL, Munin, and sshd.

  • The memory usage spikes happen at the same time every night (at 10 PM sharp.)


  • There appears to be nothing in the crontab for any of the users, and nothing in /etc/cron.d/* out of the ordinary, let alone something that would occur at 10 PM.



My question is, how do I figure out what is causing the memory suckage? I've tried the usual utilities (e.g. ps, top, etc) but I can't seem to find anything unusual.



Any ideas? Thanks in advance!

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