Thursday, 31 January 2019

windows - Shutting down the computer- reboots instead


On my Lenovo Yoga 13 with Windows 8.1, quite frequently, when I want the computer to shutdown (by pressing on Shutdown explicitly), it reboots. (it has been like that for 2 weeks I think)


I have checked the registry key PowerdownAfterShutdown, and the current value is 0. I have read on other forums that it might help to change this value to for instance to 1, but, as I recently read on http://technet.microsoft.com/en-us/library/cc939719.aspx,



Do not delete this entry from the registry or change its value. These changes can cause serious, unexpected results.



in the Caution section.


Is it that serious If I would change the value of the key, and would you recommend me doing so as a solution to this rebooting problem? Does anyone have a better solution to this problem.



Answer



The "PowerdownAfterShutdown" key has no effect on Windows 2000 or later. You're running Windows 8.1, which is newer (much, much newer) than Windows 2000, therefore this registry key has no effect.


You can set it to 0, 1, 1000, "plz", or delete it; it makes no difference.


I have a Yoga 2 11" running Windows 8.1, and I don't have this problem. But I don't run any custom drivers, I have all Windows Updates installed, and I haven't installed anything out of the ordinary.


Unfortunately, debugging reboot/poweroff/standby issues is very difficult. The tried and true method of troubleshooting is this:



  • Reinstall your OS clean with the default image from the recovery partition.

  • One by one, install every program you have installed on your current install, and after each installation, try to shutdown, and see if it reboots instead. If it does, that's your problem.

  • One by one, install every updated driver you have installed on your current install, and after each installation, try to shutdown, and see if it reboots instead. If it does, that's your problem.


I do not think there is anything under Power Options that would cause this behavior, unless maybe the Yoga doesn't work properly with Hybrid Sleep or Fast boot disabled.


If, upon a clean install of the operating system with absolutely no modifications, you can replicate this behavior, then it is either a firmware or hardware problem.


Where is the startup (autostart) folder in Windows 8?


Well, Windows 8 has no Start Menu any more and the startup folder has disappeared also.


Where can I find that folder? Or is there a new way with Metro?



Answer



It can be found here:


C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

or easier to access with this command in the Run Win+R prompt:


shell:startup

enter image description here


Here are even more explanations of how accessing/viewing the startup folder.


Does fstrim wear out SSD


I bought a samsung 840 pro 250 GB ssd ~two months ago, and I was wondering how much has been written to it. Actually, I have four partitions: /,/home,boot, and swap. To figure out how much was written to home, I wrote


$cat /sys/fs/ext4/sda7/lifetime_write_kbytes


the output was 8,985,606,440 (I added the commas). So that's 8TB. I was wondering to myself, boy I must be writing a lot. I wonder how? I monitored how much I wrote from browsing the internet and other common tasks, then I remembered that I set up a daily cron to do fstrim, because the internet told me to. So I ran


$sudo fstrim -v /home


and the output was 606,591,360 bytes were trimmed.


Then I ran


$cat /sys/fs/ext4/sda7/lifetime_write_kbytes


again and sure enough I get 8,986,209,516. So my writes increased 600MB. Now this is not really enough to account for 8TB of writes, but I had just run fstrim a few minutes earlier, so I think fstrim usually trims a lot more than 600 MB. I will have to confirm this.


Regardless, do the writes caused by fstrim actually count towards decreasing the life of your SSD? I had the impression they didn't.



I don't have to guess how much is typically trimmed by the cron job. It turns out the internet told me to log the output of fstrim. Looking at the log, I see it trimmed an average of about 150 GB/day since Aug 24, 150 GB/day * 60 days is about 9 TB. So I think the fstrim does account for the 9TB of writes I have to my SSD.



smart was not enabled on the SSD, but I ran $sudo smartctl -s on /dev/sda7. Then I ran $sudo smartctl -a /dev/sda7. This was the output:


smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.8.0-25-generic] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model: Samsung SSD 840 PRO Series
Serial Number: S1ATNSAD780426K
LU WWN Device Id: 5 002538 5a00ae961
Firmware Version: DXM05B0Q
User Capacity: 256,060,514,304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4c
Local Time is: Wed Oct 30 09:43:18 2013 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (53956) seconds.
Offline data collection
capabilities: (0x53) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 20) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 458
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 28
177 Wear_Leveling_Count 0x0013 099 099 000 Pre-fail Always - 2
179 Used_Rsvd_Blk_Cnt_Tot 0x0013 100 100 010 Pre-fail Always - 0
181 Program_Fail_Cnt_Total 0x0032 100 100 010 Old_age Always - 0
182 Erase_Fail_Count_Total 0x0032 100 100 010 Old_age Always - 0
183 Runtime_Bad_Block 0x0013 100 100 010 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0032 072 068 000 Old_age Always - 28
195 Hardware_ECC_Recovered 0x001a 200 200 000 Old_age Always - 0
199 UDMA_CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
235 Unknown_Attribute 0x0012 001 001 000 Old_age Always - 4294967148
241 Total_LBAs_Written 0x0032 099 099 000 Old_age Always - 748699270

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
255 0 65535 Read_scanning was never started
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Answer



fstrim does not wear out your ssd; on the contrary, it increases its lifespan. The writes reported in lifetime_write_kbytes refer to file system writes at a higher abstraction level and don't necessarily correspond to physical writes to the drive. So although there are 40 TB of writes reported in lifetime_write_kbytes, running $sudo smartctl -s on /dev/sda7 followed by $sudo smartctl -a /dev/sda7 reveals that I have only written 750,000,000 blocks of 512 bytes each, which comes out to 375GB, which is a more reasonable value for two months of use.


How to modify an offline device in Windows 7?


I have assigned the wrong driver to my USB mouse, and everytime I connect it the system crashes (BSoD). Now I have to change the driver, but it must be done while the device is offline. Is it possible?



Answer



Yes, it's possible but you have to enable the display of hidden devices in the Device Manager.
Follow instructions here for instance.



To get rid of that unwanted driver, device, or service:
1) Open the “Start” menu and choose “Run…”
2) Type in “cmd” (without the quotes) and click “ok”.
3) At the cmd prompt, type in “set devmgr_show_nonpresent_devices=1″ (without the quotes) and press enter. (Note that nothing seems to happen–this is ok. We are actually setting an environment variable which is going to help us to see hidden devices)
4) On the next cmd prompt line, type in “devmgmt.msc” (without the quotes) and press enter. This will launch the Windows Device Manager Console.
5) In the Device Manager Console, from the “View” menu, select “Show Hidden Devices”.



Once you find the problematic device (its icon will be faded as it's currently unplugged), either update the driver or uninstall (delete) completely the device so Windows will install it again (with the correct driver) the next time you plug it in.


How to search only for folders in Vista



In Vista file explorer, how can I use the search to find only directories matching my input?


The find is quite useful and convenient, but I cannot find a way to restrict the result list to directory items as I could in XP.



Answer



Write kind:folders in search box on top right then start typing directory name like this


kind:folders test


audio - Certain CD-R's not working in car..sometimes


I have an old Honda with a stock CD player. Certain CD's that I've burned only work sometimes. They typically fail in the morning or when it is raining/wet. I'd rather not go through the bother and expense of installing a whole new audio system.


Questions:



  • Is there an easy way to fix the player to work better?

  • Is there a brand of CD-R that is more reliable? It seems that I can play a Memorex CD-R all the time but the Maxell CD-R's most often. My Memorex CD-R is several years old, so I'm hesitant to buy more hoping it's really the same material years later.

  • Could it be my burner? The discs that work are older burnt from a desktop. The ones that fail are from a laptop. I don't have a desktop anymore so it's not too easy to try.


I'm open to other ideas and suggestions as well.



Answer



It could be a burner issue; try burning slower, at 4x or so, and see if those discs work better.


You can use the excellent ImgBurn if your normal burning software doesn't provide a friendly means of specifying the burn speed.


Oh, and make sure you aren't moving your laptop when you're burning.


windows xp - How do i keep a newly started program from taking focus?



Say i'm coding in emacs and want to start up a music program. Because it takes too long to start up i go back to coding and type away.


When the music application starts up, the focus is stolen (gasp! stolen!) away from emacs and goes to the music application, often mid-thought.


Is there any way to keep this from happening and have the newly started application not have focus until i see that it's up and ready to be used?


Besides getting rid of my ADD of course. Or getting an impossibly fast computer that can keep up with my mind.


i'm using a Windows XP system, but i will soon have a Windows 7 system, and i have Linux at home.



Answer



Create a shortcut to the music application, open its (the shortcut's) properties, and select Run Minimized in the dropdown. Save this shortcut on your desktop and use it when you want to start your app without losing focus. You probably won't know when it has fully launched without opening its window, but you can do that at a time of your choosing.


apache http server - What is the error reported for AH01757, "generating secret for digest authentication ..."?


I'm working through our web server's error log for an Open Source project. I see repeated entries for:


$ cat /var/log/httpd/error_log-20160522 | grep "digest"     
[Mon May 16 08:11:29.004792 2016] [auth_digest:notice] [pid 20628] AH01757: generating secret for digest authentication ...
[Thu May 19 09:45:18.519977 2016] [auth_digest:notice] [pid 12588] AH01757: generating secret for digest authentication ...
[Thu May 19 09:47:10.331913 2016] [auth_digest:notice] [pid 128] AH01757: generating secret for digest authentication ...
[Thu May 19 14:59:26.211893 2016] [auth_digest:notice] [pid 7102] AH01757: generating secret for digest authentication ...
...

The configuration file is /etc/httpd/conf/httpd.conf. LogLevel is set to LogLevel warn. ErrorLog is set to "logs/error_log".


What, exactly, is the error Apache is reporting? How do I fix it?




$ hostnamectl
...
Virtualization: openvz
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 2.6.32-042stab113.17
Architecture: x86-64

$ apachectl -V
Server version: Apache/2.4.6 (CentOS)
Server built: May 12 2016 10:27:23
...

Answer



Ignore it, it's informational and reporting no error. It has already been dropped to DEBUG level in 2.5.x (trunk) which means you will not see it in a later release.


I will see about getting the change in log level backported to 2.4.x


Firefox: Using multiple instances with different profiles?


Let's say, Firefox's instance is running with profile 1. Is it now possible, to start a new Firefox instance with profile 2?


Normally, when Firefox is already running, no new instance is created. Instead, just a new browser window is opened.


Note: By saying "profile", I'm referring to Firefox user profiles.



Answer



Here's an article from Lifehacker dealing with this. It's not extremely complicated, I've used this a couple of times.


windows 10 - Ping works fine, but no Internet connection in browser


Without having changed any settings, I can't access the Internet anymore through my laptop running Windows 10. Every browser tells me the connection has timed out. I can connect to the router and other devices on the network are not affected. Windows tells me that I am "connected to the Internet" but apparently, that's no help. It doesn't seem to work through other WiFi networks or ethernet either.


ping google.com works fine and surfing by IP address does not help. I tried restarting the computer, restarting the router, resetting IP configuration with no avail. I couldn't find a problem in the network settings either. I tried about anything suggested on this website. I hope someone of you has any idea as to what could resolve the issue. Thanks.


Update


So it turns out I can access google websites such as google.com or youtube, but nothing else. I tried some of the suggestions I found online, but nothing worked. Ideas?



Answer



I can't access the Internet anymore


Try reinitialising the network states. Run the following commands in an elevated cmd shell:




  • Reset WINSOCK entries to installation defaults:


    netsh winsock reset catalog




  • Reset TCP/IP stack to installation defaults:


    netsh int ip reset reset.log




  • Reset Firewall to installation defaults:


    netsh advfirewall reset




  • Flush DNS resolver cache:


    ipconfig /flushdns




  • Renew DNS client registration and refresh DHCP leases:


    ipconfig /registerdns




  • Flush routing table (reboot required):


    route /f




Multiple clients on a single Xvfb server/process?


Is is possible to use only one Xvfb process to serve multiple clients simultaneously?


Or, phrasing it differently: A Xvfb process maps directly to one screen, i.e., multiple clients share the same screen, or each new client gets a new, isolated, screen?



Answer



Yes, you can have multiple clients per Xfvb screen, much as your X display can have multiple clients.


Remember that Xvfb is essentially an XServer without a screen, just peeling off the actual video card writing and manipulation.


I'm curious as to why you need this? We needed to run this for Java code that couldn't run headless. It needed a frame buffer to write to even though it was dumping to a file only.


Wednesday, 30 January 2019

windows - How can I set firefox as the default internet browser for all new users?


My organization uses Windows 10 VirtualBox VMs to test our internal applications. The way we do this is by creating an OVA that is already connected to our domain. Anyone on the domain can log into it. However, our application initiates a single sign on java applet over the web.


I need to force FireFox as the default for all user profiles. When the VM is exported, setting FireFox as the default only applies to my profile, presumably because the other user profiles don't exist yet.


I'm thinking of tasking a VBS script to modify the registry on login for all users. Is there a more elegant way of doing this?


Thank you



Answer



What worked for me was the procedure suggested by @tyelford, which is similar to the one to make Chrome default browser on Windows 10. Unfortunately, Firefox does not have such a great how to, so I decided to copy it here and adapt it for Firefox:




As an administrator you may need to configure Firefox as the default browser on computers in your domain. To set Firefox as the default browser on domain-joined computers running Microsoft® Windows 10® and above, you must:



  • create a default application association XML file or use the provided sample file

  • create a Group Policy Object (GPO)

  • set a default associations configuration file


Microsoft® TechNet® contains detailed information on how to generate default application associations files and how to use a group policy to set the default browser.


Create a default application association XML file


The default application association file is an XML file that associates a file type with an application. For example, if you associate .html or .htm files with the Firefox application, then by default Firefox is launched each time the user opens a html or htm file.


For domain-joined computers, you create a single shared XML file that automatically sets Firefox as the default browser application. You must place this file in a shared folder, on your server, that all of the domain-joined computers can access.


Note: If Firefox is not installed on the target computer, the file associations are not applied and users must choose an application when they open a link (http or https) or file (html or htm).


The following example (firefoxdefault.xml) shows how to set Firefox as the default browser to open html, htm, http, and https files or links:















(that file I actually made myself using my computer)



Note: The default association policy is set at each login. The user can change an association after they login, but the change applies to that login session only. The association will be reset to the policy at the next login.


Create a Group Policy Object


The Group Policy Management console lets you create and manage Group Policy Objects (GPO) for your domain. These GPOs control the policies that are applied to all your domain-linked computers. After you create the GPO, you use security filtering to apply it to the computers in your domain.


In the following example, you create a GPO (Set Firefox as default browser) and apply it to computers in the firefoxforwork.com domain.



  1. Open the Group Policy Management Console. Go to Start > All programs > Administrative Tools > Group Policy Management.

  2. In the navigation pane, go to Group Policy Management > Domains.

  3. In the navigation pane, right-click on the firefoxforwork.com domain, and click Create a GPO in this domain, and Link it here...

  4. Type the name of the new GPO (in our example, the name is Set Firefox as default browser) and click OK.

  5. In the navigation pane, go to Group Policy Management > Domains > firefoxforwork.com > Group Policy Objects and select Set Firefox as default browser.

  6. In the Security Filtering pane, click Add.

  7. In the Select User, Computer, or Group window, type the name of the object you want to add, click Check Names (to verify the name you entered), and click OK. You can type Domain Computers to add all workstations and servers joined to this domain (as in the example below) or you can specify a different group of computers.

  8. The GPO now applies to all domain-linked computers.


Set a default associations configuration file


To set the default associations configuration file for domain-linked computers, you edit the related GPO on your windows server.



  1. Open the Group Policy Management Console. Go to Start > All programs > Administrative Tools > Group Policy Management.

  2. In the navigation pane, click Group Policy Management > Domains > firefoxforwork.com.

  3. Click the Linked Group Policy Objects tab to view all GPOs for this domain.

  4. Right-click on the GPO you want to select, and click Edit to open the Group Policy Management Editor. In this example, right-click on Set Firefox as default browser.

  5. In the Group Policy Management Editor, go to Computer Configuration > Policies > Administrative Template > Windows Components > File Explorer, and double-click Set a default associations configuration file.

  6. In the Set a default associations configuration file window, select the Enabled option.

  7. In the Options box, enter the location of your default application association XML file. This is the XML file that associates file types (such as .htm, .html, http, and https) with the Firefox application. This can be the Firefox provided sample XML file or one you created yourself.


Note: The file can’t be a local file on the server. It must be at a location that is accessible to every computer in the domain.


Verify your configuration


On your target computers (that is, the Active Directory domain-joined computers running Windows 10), you can verify that the GPO you created has been applied, and that the computer is using Firefox as the default browser.


The GPO is applied automatically when the policy is refreshed by the Windows Client, or you can run the GPUpdate.exe /force command to force a manual refresh at any time.


Note: After the policy is downloaded and applied, the computer must be rebooted in order for the policy to take effect.



  1. On a Windows Client, go to Windows > System32. Right-click rsop.msc and select run as administrator.

  2. Authenticate with administrator credentials and click Yes.

  3. Go to Computer Configuration > Administrative Templates > Windows Components > File Explorer to confirm that Set a default associations configuration file is available.

  4. Open the Set a default associations configuration file to confirm that the setting is enabled and that the XML file location is correct.

  5. When Firefox is set as the default browser, then all files with htm and html extensions use the Firefox icon.



Reference: Make Chrome default browser on Windows 10 - Chrome for business and education Help


Other pages that may be helpful:



gnome - Linux: How does user log out work

I'm new with linux. I've searched about how to safely log out other user and found few solution but I want to know how they work internally. I have few questions:
1. pkill -KILL -u {username} Does it just send SIGKILL to every child of init --user? and does it ensure that every child process is safely killed?
2. Can It be done using sending only signals?


P.S I have program which creates init --user for other user, I'm killing using SIGTERM but sometimes compiz crashes. Thats why I'm interesting how should it work properly.

linux - Deleting another user's directories from my own


I am a non-root user, and have made a directory into which other users in my group can write. The directory is setgid, so files and directories within it have the same group.


I can delete files placed into this directory, but if a user creates a subdirectory with files in it, I can't seem to delete those. Is there something special I can do (other than, say, bothering the user in question or the sysadmin about it) to get rid of this subdirectory?


EDIT: Inevitably, of course, someone asks "why?"


The shared folder in question is a mercurial repository. We can't use a shared-account ssh-key-based server for this like mercurial-server, and we can't just host it externally for various reasons. But that part works fine. We use Redmine for project management, but it does not yet read the repo index for file contents - it reads the working directory. So the working directory must be kept up-to-date. crontab has been disabled by the sysadmin, so that's out. So I naïvely put a changeset hook in the shared repo that performed an "hg update". This seemed to work fine initially, until, of course, someone pushed a commit with a new directory. While I had vague thoughts of trying to make a setuid script for the hook, I'll probably just consider safer avenues.



Answer



In order to delete a file in a directory, you need to have write permission to that directory. Obviously the users are creating directories without you having write permission, in which case the answer to your question is no, you can't do anything without talking to the user in question or the sysadmin.


However, if I was the sysadmin, I would be worried about what you're doing. It is not normal for users to be creating files in other users directories. Is there a better way of doing what you're doing? For example, uploading to a suitable web application would give better control, and also mean that you don't have to worry about this.


virtualbox - I have windows 7 os installed in virtual box .I want to install software in this os .How to do that?


I have windows 7 os installed in virtual box .I want to install software in this os .How to do that? how to locate setup file in drive .



Answer



You need to get the installer (.exe) inside the guest OS. There are several ways to do this:



  1. download from the internet inside the guest OS

  2. connect a USB flash drive, copy the installer onto it, and make the USB drive visible inside the guest OS. If you are running linux as host, you need to run VirtualBox as root otherwise the USB drives are not visible.

  3. enable folder sharing between the guest and host OS and copy the .exe into the shared folder


macos - Can I open a folder in the current Finder window, rather than getting a new window for each folder?

In Mac's Finder, I have a million windows piled on top of each other when I finally find a file I want.


Is there any way to select a subfolder and when it opens, have it REPLACE the current open window in order to avoid pileup?

windows 8 - Spotify, Youtube, Shockwave Flash, and other programs not working

When I open spotify it will continuously load or if it stops i cannot play a song, also on Youtube i can click on a video from the homepage but the video will not load and i cannot click on anything. Other video sites will also crash and i get the "shockwave has stopped working" popup. Even Windows Media Player, skype, and steam don't work. I have updated countless things, restarted multiple times, and checked for viruses and have gotten no change. Is there anything I should do or do i need to just reboot to an earlier date? Sometimes Youtube will work for one video then no longer work at all.


I have done a spybot search and an avast search and neither came up with anything. I also don't believe i have any refresh dates for my computer so I want to use that as a last choice.

macos - How can I extract .rar files on the Mac?



Is there anything built-in that does this? (E.g. command line tools.) Or are there any third-party apps?


Update: I like The Unarchiver, but vote up your favourite, or add it as an answer if it isn’t there.



Answer



The Unarchiver really does it's job well (and it's also completely free). From the site:



Supported file formats include Zip, Tar-GZip, Tar-BZip2, RAR, 7-zip, LhA, StuffIt and many other more and less obscure formats. The goal is to make The Unarchiver able to extract anything you give it. The Unarchiver uses the libxad unarchiving library to support many older, obscure formats.



RAM with Same Type but different Memory Clocks?

I have a 1 GB DDR2 667 MHz RAM


installed into my system


can i use 2 GB DDR2 800 MHz RAM


along with the existing RAM


is there any problem if i use both in different slots simultaneously


or


shall i remove the previous RAM.

macos - Recover Files From Formatted HFS+ Partition


I offered to help a friend of mine with his computer, and it turned out to be a bit more complicated than I first thought. He originally came to me asking me to recover some of his files from his MacBook. Turns out he used the Vista partition manager to format the Mac partition to NTFS. He said he was trying to resize his partitions, and messed up somehow.


How does one recover files from an HFS+ filesystem? It's been formatted as NTFS, but so far as I know, it hasn't been booted, so the files should be mostly intact. Are there any tools for this, or should I just tell him his files are gone?



Answer



If one is a fast learner, you could use TestDisk to repair the HFS+ partition.



TestDisk is […] free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).



community faq - How can I tell which versions of Windows 8 a program will work on?


I've heard that there are two versions of Windows 8, and that some programs will only work on certain versions. What are the different versions of Windows 8, and how can I tell whether a particular program will work on one or the other?



Answer



There are three versions of Windows 8. For more details, see "What is the difference between Windows 8 Pro and Windows RT".




  • Windows 8 and Windows 8 Pro have the new Metro interface, but also have the old Windows 7 style desktop. These OSes will be compatible with almost any Windows software.




  • Windows RT has only the new Metro interface, with very limited desktop support for a few built-in apps. Generally, only new apps will run on this version.




To figure out if your application will run on your Windows 8 device, first determine which version of Windows you have. If you aren't sure, try getting to the desktop. If you're able to get to the desktop, press Windows Key + R, and type winver, then hit enter. This will display your Windows version. If you're unable to get to the desktop, you probably have Windows RT.




  • If you have Windows 8 or Windows 8 Pro:
    Any program in the Windows Store will work on these versions of Windows. All Metro apps will be supported. You can also run most legacy Windows applications. Any program that runs on Windows 7 should run on Windows 8, unless it's a low-level program such as certain interface customization programs.




  • If you have Windows RT:
    Any Metro app in the Windows Store will run. Legacy applications will not work unless the developers have created a specific Metro version. If your program worked in Windows 7, it probably will not work on Windows RT.




windows - How to change the cmd.exe font?




Possible Duplicate:
How to change the Windows console font?



Firstly: I have tried the options dialog for it (the one that Windows shows) and I don't want that.
The default windows option dialog for it only allows two fonts: "Raster"(Fixedsys) and Lucida Console. However, I want to use Consolas (which is a really chic font). I've tried messing with the registry options for the current user "HKEY_CURRENT_USER\Console" but it doesn't seem to work. Help appreciated.



Answer



I think you're changing the wrong key. Navigate to:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont\

Right click in the blank white space in the right pane and select New -> String Value.


Edit the value to these settings:


Name: 00
Data: Consolas

Open command prompt and you should be able to switch to Consolas font in the properties. A reboot is essential for it to appear properly. I'd also recommend to turn on cleartype to make it look smoother. Consolas looks best with cleartype on.


windows 7 - Warning when battery is fully charged


I would like to get an alert (with sound) when my laptop battery is fully charged.


How can I do that?



Answer



Try Laptop Battery Monitor:



Laptop Battery Monitor, is an intelligent laptop battery monitoring software. It accurately displays an estimated time, until your battery will discharge, or fully charge. You no longer have to worry on how much battery power you have left, when you can have this information in hours, minutes and seconds. Features are display remaining time until the battery is fully discharged (when running on batteries), display remaining time until the battery is fully charged (when the battery is charging from the AC power supply), application runs in system tray, using minimum memory, and screen space, custom indicator colors, sound alerts when charging starts/stops, battery is full charged, or battery charge drops under a predefined percentage, automatically starts when you turn on your laptop. Works with any laptop and battery model, new or used.



Tuesday, 29 January 2019

networking - Multiple Wi-Fi cards and Internet connections on Windows 7

I have two Wi-Fi cards and two separate Internet connections.


I connect to the Internet with both of them but one does all of the Internet transactions (and I have not seen any place where I can specify which one I would prefer to use!)


What I would like to do is use one of them for the browser and Skype only, and the other one for stock exchange software for instance.


Is this is possible?

Is there a way to show only specific values in x-axis of an excel chart?

In my problem, I have 0.1 0.2 0.5 1.0 on the x-axis and I want to plot my chart by showing only these values on the horizontal-axis. Is there anyway or any extension (like kutools) to make this happen in Excel? Or any other tool suggestion would be nice, like R, gnuplot, etc.


For example, in the following figure, you can see what I mean about the x-axis. Thanks in advance.


An example chart

audio - Re-stream shoutcast stream


Basically I want to 'Re-stream' a shoutcast stream.
MP3 stream that is.


Tried searching around but couldn't find a way to do this. (It's an internet radio where only some of my friends get it without lag, so they could restream it.)



Answer



I don't know a lot about Shotcast and if you want to stream through that, I don't know what to suggest.


If you are saying that you have a MP3 file and you want to stream that, I would recommend either Windows Media Services off of Windows Server if you have a spare box lying around, or even just using VLC Media Player - it has an excellent built in streamer.


How to connect 2 virtual machines(VMWare Workstation 7.0) in a separate network?


There are supposed to be 2 networks: i) The first one is the one which all the virtual machines and the host share(Host-only condition). This one is easily achievable for me, as an amateurish beginner. ii)The second network is the one in which only 2 virtual machines are to be connected. These 2 virtual machines should also be connected to the Network(i).


I understand that for the 2 virtual hosts that are to be connected in a separate networks simultaneously, it means that they need to have 2 IPs, and hence 2 ports(physical)/ethernet interfaces?



Answer



VMWare calls them Lan Segments.



Configuring LAN Segments


A LAN segment is a private network that is shared by other virtual machines. A LAN segment can be useful for multitier testing, network performance analysis, and situations where virtual machine isolation are important.



For Workstation 9 it is in the help Using VMWare Workstation under the topic Configuring Network Connections.


keyboard shortcuts - What is the name of this Ubuntu program?


A couple month ago I installed a bunch of clipboard manager programs in Ubuntu, tried them out and then removed them. I must have missed one of these and now it keeps bug me in my daily usage. I need some help to identify the name of this program because the program itself provides very limited information.


This clipboard program has below characteristics:
1. It occupies hotkey Ctrl+;. When I press this hotkey, the clipboard history will pop out. It happens in bash, Chrome, Eclipse IDE, and etc, wherever it is text inputable. This is kind of annoying because it overrides my other hotkeys inside these applications.
2. Very laconic UI. Like below picture, with only a line "Select to paste", then listing out the clipboard history. There is no program information whatsoever. Right clicking on it and no menu are shown at all.


enter image description here




So far I have tried below ways to identify this program:
1. Browse system monitor for processes with names that could be correlated.
2. Browse through my installation log (dpkg.log) to find my installation history. Without luck, the log is lost.
But I was not successful.



Answer



According to Debian Code Search, this is the clipboard plugin for the fcitx input method (which is normally used for multi-language keyboard input).


How to capture Internet connection event in Windows Task Scheduler?


I'm trying to create a simple task in Windows 7 that would run some script after every connection to the Internet. My gateway restart itself sometimes and I want to run that script every time Internet connection is restored.


In task creation wizard I choose that task should start "When a specific event is logged." But I don't know which one.



Answer



I would use Task Scheduler to trigger the script on connection to a network, then use the script to confirm presence of the internet.


The Microsoft-Windows-NetworkProfile/Operational event log gets an event 10000 upon connection to a network, so you can use that to trigger your script.


Then at the beginning of the script, you could have something like:


ping 8.8.8.8 | find "Reply"
if errorlevel 1 goto :eof

# Your script

Clean install Windows 10


I have googled but can't find a definite answer to my question. All the answers are incomplete.


I want to clean install Windows 10 using USB. When restarting from USB I want to use advanced and format all the partitions and create one partition then install Windows 10 on it.


I bought my HP laptop with Windows 8 and upgraded for free to Windows 10 and activated auto.


Will Windows 10 activate after I remove all partitions and create one partition out of them and then install Windows 10 on it?


I have 2/3 Recovery partitions and windows old folder etc. Before the upgrade I only had one Recovery partition.


Scenario 1:


I have one Desktop with win8 activated, used free upgrade to win10 and activated. Formatted HDD and re-installed win10 with USB media from Microsoft. It did not activate after clean install. I had to install win8, activate it, upgrade to win10 and then it activated.


Scenario 2:


I have one laptop with windows 8 activated, used free upgrade to win10. Now I want to format all my partitions because they are useless and make one partition. This is possible when formatting. Because my HP laptop came with OEM OS, I do not have a serial because it was embedded in the recovery. So I can't use a serial to activate win10 if it does not activate itself. I also do not have the serial in this case to install win8 and activate it and then upgrade to win10 if win10 does not activate the same way as scenario 1.


I need an answer to if I can remove all paritions, create one and install Windows 10 on it so it activates. Or is the hidden super secret spy serial key stored on one of those partitions?



Answer



I went to CMD and typed slmgr /xpr to check if my Windows was activated Permanently. It was so I proceeded with the following:


HP Laptop with OEM Windows 8 upgraded to Windows 10 for free. After that I made the media creation tool provided by Microsoft. Then I went to Start -> Settings -> Update & Security -> Recovery -> Under advanced start-up selected Restart now -> selected the USB that Windows 10 was on and skipped the part where it asks for the key. Then selected advanced and removed all partitions. Then made a new partition and it created 4 partitions. I installed Windows 10 on the primary one, in my case partition 4. After connecting to the internet and using the same Hotmail Microsoft account Windows was activated.


I remember doing the same on my home Desktop few months ago, but then it did not activate and I had to re-install 8, upgrade to 10 to activate it.


macos - Change the OS X Dock background


I find that with some wallpapers, the Dock that ships with Leopard can be way too bright and stand out more than desired. How can I change the appearance of the Dock?



Answer



LeopardDocks is a great website that has lots and lots of different replacement dock backgrounds. To use the files the website provides, just use their LeopardDocks App.


linux - Windows won't sleep after booting from grub

I recently added a second hard drive to my computer and I am using it do dual-boot Linux (Ubuntu 12.04) with Windows 7. Both hard drives are SATA. I am using the default grub bootloader on my second hard drive. The windows drive is unmodified. To get to grub, I changed the hard disk boot priority in my BIOS (P35-DS3L) to boot from the second drive.


The problem I'm having is that when I boot to Windows 7 (on sda) from grub (on sdb), Windows 7 will not go to sleep (from the start menu). The display shuts off momentarily as if its going to sleep, then comes back on and displays the switch-user screen. Powercfg -lastwake does not show anything.


I am sure that this is related to booting from grub on sdb because when I change the hard disk boot priority in the BIOS to boot from my (unmodified) Windows hard disk, the computer goes to sleep fine.


It occurred to me that installing grub on sda might solve the problem, but I'd rather not since I like to have my windows hard disk unmodified so that booting to it from the BIOS boots directly to windows.


A possible work around is to use the BIOS as a bootloader, by pressing F8 to select the boot device. Still, I'd like to know why the problem is happening in the first place.

multiple monitors - Open Worksheets In New Window In Excel 2010 Without Administrative Access


Software configuration:



  • Microsoft Office 2010 Professional (Excel 2010)

  • Windows 7 Enterprise SP1

  • Logged into the computer as a Standard User (not Administrator or Power User)


Problem:



  • Want to open every Excel workbook (typically accessed via hyperlink in Outlook or directly using Windows Explorer) in a separate instance of Excel for easy multi-monitor arrangement

  • No administrative access, so most traditional approaches don't work


What do I do? See below for the solution.



Answer



Solution:


A simple registry edit in HKEY_CURRENT_USER (which most Standard User Windows accounts should have read/write access to!) will resolve the problem.


First, Save the following data into a text file:




Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.12]

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.12\shell]
@="OpenNewWindow"

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.12\shell\OpenNewWindow]
@="&OpenNewWindow"

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.12\shell\OpenNewWindow\command]
@="\"C:\\Program Files\\Microsoft Office\\Office14\\EXCEL.EXE\" \"%1\""
"command2"=hex(7):78,00,62,00,27,00,42,00,56,00,35,00,21,00,21,00,21,00,21,00,\
21,00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,45,00,58,00,43,\
00,45,00,4c,00,46,00,69,00,6c,00,65,00,73,00,3e,00,56,00,69,00,6a,00,71,00,\
42,00,6f,00,66,00,28,00,59,00,38,00,27,00,77,00,21,00,46,00,49,00,64,00,31,\
00,67,00,4c,00,51,00,20,00,00,00,00,00

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.8]

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.8\shell]
@="OpenNewWindow"

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.8\shell\OpenNewWindow]
@="&OpenNewWindow"

[HKEY_CURRENT_USER\Software\Classes\Excel.Sheet.8\shell\OpenNewWindow\command]
@="\"C:\\Program Files\\Microsoft Office\\Office14\\EXCEL.EXE\" \"%1\""
"command2"=hex(7):78,00,62,00,27,00,42,00,56,00,35,00,21,00,21,00,21,00,21,00,\
21,00,21,00,21,00,21,00,21,00,4d,00,4b,00,4b,00,53,00,6b,00,45,00,58,00,43,\
00,45,00,4c,00,46,00,69,00,6c,00,65,00,73,00,3e,00,56,00,69,00,6a,00,71,00,\
42,00,6f,00,66,00,28,00,59,00,38,00,27,00,77,00,21,00,46,00,49,00,64,00,31,\
00,67,00,4c,00,51,00,20,00,00,00,00,00

Second, rename the text file with the .reg extension (NOT .reg.txt!).


Third, double-click the file, and click Yes at the prompt, then OK at the second prompt. It should look something like this:


regedit


Fourth, close all open instances of Excel (you may have to restart your computer or look in Task Manager if there are hidden open instances).


Fifth, try opening files by double-clicking them in Windows Explorer, or by clicking on a hyperlink in an email or document. Each workbook file should open in a separate instance of Excel, independently controllable, rather than in the single-window MDI interface.


If there are specific files that you want to open in the same instance as the most recent instance of Excel, you can right-click the file and select the "Open" option (not OpenNewWindow).


laptop - Disable CD-ROM in BIOS


I have a Lenovo T420 laptop. The reason I want to disable the CD-ROM is because when moving the laptop, I often unintentionally press the eject button, which turns on CD-ROM's power and pops the tray open - it's annoying for me. I am looking for a way to power off CD-ROM, and only power back on when I re-configure it, preferably done through the BIOS.



Answer



Disabling the effect of the eject button can be controlled at the OS level. Use CDRom-Lock or eject -i on to lock the drive closed.


windows xp - Why do I need to keep "$hf_mig$"?


After having read the Microsoft's explanation and also some others, I still don't get it:



When a security update, critical update, update, update rollup, driver, or feature pack installs GDR version files, the hotfix files are also copied to the %windir%\$hf_mig$ folder. This supports migration to the appropriate files if you later install a hotfix or service pack that includes earlier versions of these files. For example, consider the following scenario:


You apply a security update that installs a GDR version of File.dll with a version number of 5.2.3790.1000 and copies a hotfix version of File.dll with a version number of 5.2.3790.1000 to the %windir%\$hf_mig$ folder.


You apply a hotfix that includes a hotfix version of File.dll with a version number of 5.2.3790.0000.


In this scenario the hotfix installation in step 2 installs the hotfix version of File.dll (version number 5.2.3790.1000) from the %windir%\$hf_mig$ folder instead of the hotfix version of File.dll (version number 5.2.3790.0000) from the hotfix package.



I don't get it. Why not this way:



  • You apply the first thing containing the version 5.2.3790.1000, the old version gets replaced.

  • You apply the second thing containing the version 5.2.3790.0000, the updater finds out that your version is newer and leaves the file alone.


The advantages are obvious, so am I misunderstanding it?



Answer




  • Not every feature is installed at once. A patch may deliver an updated file.dll that nothing is using. You later install a feature using file.dll and you get the latest version that the system can provide -- which isn't necessarily the one on the installation media.

  • You remove a feature. file.dll gets removed from %systemroot%\system32. You later reinstall the feature (or another program/feature that requires file.dll). If you didn't have the cached version in $hf_mig$, you'd have an insecure or unstable version of file.dll. If you're especially unlucky, it got installed via some method that prevents Windows Update from correctly noticing the old file version.

  • Patches were often delivered for different SP levels at once. If you weren't running the latest service pack, installing the service pack would install older versions of file.dll without the cached versions in $hf_mig$. Or say you need to uninstall a SP -- you'll get rolled back to the latest versions available in $hf_mig$ rather than whatever was delivered with SP2 (vs. SP3), which will minimize the number of updates you'll have to re-download via Windows Update.

  • IIRC, this can also be used to track non-versioned files and make sure they're as up to date as possible.


Basically, it's used in scenarios where Windows features, patches, and service packs are added on and removed after initial system installation and updating. If all you ever do is install Windows, go to Add/Remove Features right afterwards once, and only ever add updates to your system, it might not make a lot of sense. For everyone else who might have occasion to roll back a bad patch, uninstall a misbehaving SP, or add a feature to Windows much later in a system's lifecycle, it's a necessity for making sure that the latest versions of files can be delivered as soon as possible rather than requiring a user to re-run Windows update after every minor system change.


Monday, 28 January 2019

diff ignoring eol and whitespace


I would like to diff two files, such that end of lines and white space be ignored. Namely, I would like diff to find no difference between d1.txt and d2.txt:


$ cat d1.txt                                                                    
test1

test2

test3

test4
$ cat d2.txt
test1test2test3test4

For some reason,



diff -d -w -a --strip-trailing-cr d1.txt d2.txt



does not do the job. Any help is appreciated.



Answer



diff compares lines, see man diff:


diff - compare files line by line

Ignoring white space means that foo bar will match foobar if on the same line. Since your patterns in d1.txt span multiple lines, the files will always differ. I haven;t actually read the source code but I guess diff works something like:


for each line number X in file1;
line1 = line X from file1
line2= line X from file2
If line1 is equal to line2 the do something
else do something else

The first line of your file1 is not the same as the first line of file2 so a difference is reported. If you really want to check that the files contain the exact same non-whitespace characters, you could try something like this:


diff <(perl -ne 's/\s*//xg; print' d1.txt) <(perl -ne 's/\s*/g; print' d2.txt)

windows xp - Dell Inspiron 9300 Laptop forgets External monitor (Westinghouse LCD TV) resolution setting on reboot

When I hook my laptop up to my LCD TV via the VGA cable it always starts off with a resolution of 1280x1024. I change it to my desired setting 1920x1080 and all is well until I reboot the computer and it goes back to 1280x1024.


I am using the LCD TV screen by itself, I have the laptop lid closed.


This just started to happen a few months ago, prior to that the laptop would remember the previous screen resolution setting.


Dell Inspiron 9300, running XP Pro.

audio recording - Can I hook up my stereo line-out to my Mac's line-in to record cassette tapes?


Can I hook up my stereo/boom-box's line-out (headphone) to my Mac's line-in (or microphone input)? What will be the side-effects, if any?


I want to record old cassette tapes as MP3/WAV/whatever on my Mac.



Answer




Can I hook up my stereo/boom-box's line-out (headphone) to my Mac's line-in (or microphone input)?



Update:


tl;dr: You can connect a "line-out" to a "line-in" and all will be well.


As slhck commented below, current MacBooks have a "line-in" socket that is for "a line-level microphone" which isn't your normal mic-in socket found on typical Windows/Linux PC hardware. A line-level input should be less vulnerable than a mic-level input (though it isn't designed for a headphone output expecting a 32-ohm impedance.) Designers of modern Macs and PCs probably make provision for end-users plugging inappropriate outputs into sensitive inputs


Normally, each of the following audio interfaces are different and (at least for quality reasons) should not be mixed up



  • line-in and line-out

  • headphone out

  • microphone in


Each interface is electrically different.


Line-in is explicitly designed to be connected to line-out (on a different device usually) and vice versa. These are high-impedance, low-current signal interfaces.


Microphone-in is designed for connecting microphones, these produce much weaker signals than line-out and normally need pre-amplification before being fed to a line-in interface.


Headphone outputs are designed for relatively low-impedance devices that use a much higher signal level. It would normally be a bad idea to connect a headphone-output to a microphone-input, at best you should expect clipping and distortion.


I think some computers have connectors whose electronics can be switched in software to provide appropriate impedance etc for two different signal levels.




Update:


Stricly speaking, you should use impedance matching and attenuation in between headphone-out and microphone input. This can be done with attenuating leads, DI boxes etc


For example, the description of this product says




  • Outputs Mic Level

  • Speaker Level Input



Or this one




  • Adjustable speaker simulation

  • Balanced mic level output



worksheet function - Excel 2010 formula to strip out part of cells


I have used basic IF ISNUMBER functions before to identify parts of cells and return the value in a different cell, such as:


=IF(ISNUMBER(VALUE(RIGHT(B5,1))),"",IF(ISNUMBER(VALUE(MID(B5,LEN(B5)-1,1))),RIGHT(B5,1),RIGHT(B5,2)))

How can i adapt this formula to look for a number/txt value and strip it out? Or would it be better to write new formula? Feel free to tell me where i've gone wrong previously! ;)


Note: the above formula isn't for the data below


Here is an example of the cell contents, I want to strip out the sizes (3L, 10L etc), the 'BARE ROOT' / 'ROOT BALL' / 'FEATHERED' and Girth sizes leaving only the names remaining.


ACANTHUS spinosus                  3L
ACANTHUS spinosus 3L
ACER campestre 10L
ACER campestre 3L
ACER campestre BARE ROOT 14/16GIRTH
ACER campestre BARE ROOT 150/175cm
ACER campestre BARE ROOT 30/40cm
ACER campestre BARE ROOT 40/60cm
ACER campestre BARE ROOT 60/80cm
ACER campestre BARE ROOT 80/100cm
ACER campestre BARE ROOT 80/100cm
ACER campestre BARE ROOT 80/100cm
ACER campestre BARE ROOT 80/100cm
ACER campestre 'Elsrijk' ROOT BALL 10/12GIRTH
ACER campestre 'Elsrijk' ROOT BALL 14/16GIRTH
ACER japonicum 'Aconitifolium' 10L 125/150cm
ACER japonicum 'Aconitifolium' 10L 60/80cm
ACER negundo 'Flamingo' 50L 200/250cm
ACER p. d. 'Dissectum Atropurpurea'70L 16/18GIRTH
ACER p. d. 'Dissectum Palmatifidum'25L FEATHERED
ACER p. d. 'Dissectum Palmatifidum'25L FEATHERED

More info
Looking through the sheet, the maxium name length is 35 characters, anything after that is size related and stripable, so some code to strip out after character 35 would be enough, then something to remove instances of more than 1 space would suffice...


Method 1
I've used {=LEFT(C2, MATCH(TRUE,ISNUMBER(1*MID(C2, ROW($1:$65), 1)),0)-1)} which is close to what i need, now just a way to identify the BARE ROOT and ROOT BALL, C2 is my cell... Also want it to not report 'ERROR' when no number is found... :)


Method 2 (Current Solution)
=LEFT(C2,35) as suggested by Paul below!



Answer



This question was answered in the comments and was collaborative, but here is my answer combined with Tony's:


=TRIM(LEFT(C2,35))

Risks of removing fuse from Linux (to get rid of .fuse_hidden files)

What are the side effects of removing fuse from Ubuntu server 16.04?


Each time I want to remove a movie from this machine, it just gets renamed to .fuse_hidden.


Stopping the movie server (Plex) does not solve the problem, the only way to actually get rid of the file is to reboot. I have tried using lsof to locate the service using the file to no avail.


If I remove fuse (sudo apt-get remove --auto-remove fuse) what are some of the pitfalls? Will my system become unstable?


By removing fuse, will deleting the file have the expected results? i.e. will the file go away?

wireless networking - Does WiFi LAN gaming affect the internet of other users?


I know it probably slows down the network for the ones that are engaged in the LAN multiplayer game because the packet queue gets filled up, but does it affect other users that are accessing the internet?



Answer



Go to WiFi near the bottom of the message, bellow is some stuff more related to protocols and wired connection.


If the Internet Protocol is used, some congestion may occur ONLY if the game is using UDP/broadcasting for the multiplayer, as broadcasting means a packet is sent to all the computers in the network.


If IPX/SPX is used, then it also depends on the implementation. The only experience I had with this was in Bomberman, which definitely used broadcast => packets sent all over the network (routers went nuts - Internet was available, but routers thought it was some kind of attack LOL).


Overall, I would say that the chances a LAN party chokes the Internet connection are fairly slim, if the LAN has proper switches.


What could go wrong:



  1. a switch is broken and sends erroneous packets;

  2. a computer's LAN card is broken;

  3. some computers are infected with a malware which is designed to create traffic on the network;

  4. the last, but not the least, the game you are playing is using UDP intensively (there are games that use TCP and also UDP, but just for finding game servers, pinging players - those are not UDP intensive).


Edit: Oh, WiFi, got confused by the "hubs" post...


For WiFi, it depends:


If the WiFi transmitter is the Router, it could cause latency for the Internet connection. It very much depends on the router's capability: how many computers can be connected at the same time (number of wireless frames or fragments), can it prioritize packets.


If the WiFi transmitter is independent from the router, then, it shouldn't be a problem for the devices connected by wire or through another wireless transmitter. If they are using the same WiFi, then you get the same thing as for the WiFi router.


So, for WiFi, yes, if there are many computers, much traffic from the game, and surely if the WiFi is also secured.


ubuntu - Grub2 fails to chainload Windows 7 with error "invalid signature"


I've built a new UEFI 64-bit system with both Windows 7 and Ubuntu 11.10 installed (on separate hard drives). I'd like to be able to boot Windows 7 from the grub menu, but I have so far been unsuccessful in getting grub to chainload it.


After getting the grub menu, I choose the option for the command line and I can see that bootmgfw.efi is at (hd1,gpt1)/efi/Microsoft/Boot/bootmgfw.efi. However, when I attempt to chainload I get an error:


grub> chainloader (hd1,gpt1)/efi/Microsoft/Boot/bootmgfw.efi
error: invalid signature

I am not sure whether I chose the UEFI boot option when I installed Linux from the LiveCD, and so I am wondering if the grub I have is perhaps unable to chainload in this manner? In any case I am not sure how to get the chainload to work.



Answer



As I began to suspect when I was writing my question, the issue is that Linux was installed using MBR, so that grub was unable to chainload an EFI Windows 7. I reinstalled Linux, this time making sure to select the UEFI boot option for the LiveCD from BIOS. With Linux now installed with an EFI grub, I was able to add a grub menu entry for Windows 7 and chainload successfully.


I used this link to create the menu entry for Windows 7.


After doing sudo vi /etc/grub.d/40_custom and adding the menu entry to the end of the file, don't forget to run sudo update-grub.


command line - Difference between UnxUtils and GnuWin32?


I am a Windows user who wants programs like grep and sed along with other utilities like ls, cut etc in my command prompt. I came across 2 packages which would accomplish this



I would like to know what is the difference between the two both feature wise and more importantly performance wise before I choose between them. From what I have seen GnuWin32 is a super set of UnxUtils. Is this correct ?


Note by Barlop
this question was asking about coreutils and unxutils, but since he was talking about grep and sed, it's clear he meant to ask about gnuwin32 and unxutils, and that is a much more useful and important question than the mistaken one. If people want to revert it to coreutils and unxutils then i'd be happy to go with that and post another question for gnuwin32 and unxutils. Also, any proper answer to his original question would correct or answer regarding his mistake but also answer what he meant. So there's no loss in correcting his question.



Answer



unxutils has really old versions of a bunch of some of the most useful utilities. including grep for example.


gnuwin32 versions are also many years out of date, though not nearly old as unxutils. Gnuwin32 has a much larger number of utilities. That's obviously a major advantage.


Bear in mind that gnuwin32 has that major advantage over unxutils.


As an example..


The extremely old unxutils


C:\unxutils>grep -V
grep (GNU grep) 2.4.2

Copyright 1988...

The rather old gnuwin32


C:\blah>"c:\Program Files (x86)\GnuWin32\bin\grep.exe" -V
GNU grep 2.5.4

Copyright (C) 2009 ...

Contrast with software that is kept more up to date than gnuwin32 e.g. cygwin


$ grep --version
grep (GNU grep) 2.21
Copyright (C) 2014 Free Software Foundation, Inc.

With unxutils, you can run into issues as it uses really old versions, and when looking for help people will expect you to have the latest version of this or that command.


There are some smaller advantages that unxutils has, that makes unxutils very useful.



  • unxutils has xxd, gnuwin32 does not. (Note, VIM 7 also has xxd, so does cygwin)


  • gnuwin32 as of writing(2014) has a broken tail -f, unxutils's tail -f is older but works. (mentioned here Cygwin's tail also works ). On two different occasions i've run into bugs in gnuwin32 grep which have been fixed in later versions of grep and cygwin's grep was much later and fine(and can be run straight from cmd.exe and doesn't have to be run from the cygwin shell).




  • the following is a smaller advantage, but if you're very lazy, or just want to use it quickly, then unxutils is just a zip you can extract the executables and go. Gnuwin32 involves a wizard to install various bits, and even some individual utilities have to be installed separately like a setup executable for wget, one for grep e.g. (grep-xxxx-bin.exe). with unxutils you just extract from their wbin directory within the zip. Bear in mind though they are older versions so if possible, if not being too lazy, one would generally see if gnuwin32 has it.



  • unxutils can work standalone where lots of the equivalent gnuwin32 binaries cannot. So if you don't want to or can't install gnuwin32 then you can use a command standalone, from unxutils. For example, gnuwin32's tr.exe requires two dll files in its directory or it says they're not there and won't run. gnuwin32's sed doesn't work standalone, whereas unxutils tr.exe and sed.exe work fine standalone.

  • unxutils has gclip.exe and pclip.exe They are commands to copy to the clipboard and paste from the clipboard. gnuwin32 doesn't seem to have anything like it, and windows natively has clip.exe (to copy to the clipboard), but no command to paste it like pclip.


The unxutils sourceforge link has unxutils.zip and unxupdates.zip (the latter being a subset of unxutils.zip but with later though still old versions). e.g. unxutils has sed from 1998, and unxupdates has one from 2003. That can help e.g. the 1998 sed doesn't have \d or \x notation e.g. e.g. \d34 or \x22 to specify quotes(easier than escaping quotes),. The unxupdates one is from 2003 and does.


The gnuwin32 sed, as of writing, is from 2009. (Gnuwin32's is still out of date as there is a grep version even for 2014 http://ftp.gnu.org/gnu/grep/ but gnuwin32's is much less out of date than unxutils(even when unxutils is considered with 'unxupdates').


The http://unxutils.sourceforge.net/ site's unxutils.zip is down but is available https://archive.org/details/UnxUtils and officially https://sourceforge.net/projects/unxutils/ and if you're going to get it then download unxupdates too


Comparing gnuwin32 to unxutils, generally look to Gnuwin32, but know that unxutils has some advantages.. Gnuwin32 has almost all the commands that unxutils has, plus a lot more.


And also, look to Cygwin, it has a huge collection of utilities kept much more up to date than gnuwin32, (they should be run from cygwin's bash shell, which is fine by me), you generally don't really need to look at something ancient and not updated like unxutils, though it does have pclip and gclip.


besides gnuwin32 and unxutils, there are also MinGW and cygwin and Windows SUA(which as of writing, MS still maintains and would be up to date) and GOW(which is small, though the GOW github page shows it as last updated 2014) and smaller still, BusyBox(famous for android but is available for Windows, here and is still very small. The two most impressively featured for me are gnuwin32 and cygwin (and cygwin has xxd and a working tail -f. so I don't need to resort to unxutils) With cygwin, programs should really be run from the cygwin shell but its a linux shell e.g. bash shell and bash and other linux shells are powerful so no loss there. Also bear in mind that nowadays many people use linux virtual machines instead of cygwin or gnuwin32, which really gets up to date proper versions of the commands, rather than windows ports that can be older and can behave differently with quotes.


Added Note- coreutils aka gnu coreutils, is a bunch of commands that run on linux (..), and no doubt the GNU OS with Herd (a less widely used OS!), and probably has some decent implementations done for other *nix OSs. GNU Coreutils is well known and extremely widely used and useful and updated. On the other hand unxutils is a very old implementation/port of some commands people use on linux or unix, (which would no doubt include some coreutils commands), done for the windows OS. The two wouldn't normally even be mentioned in the same sentence and the only reason why they were in the original question, was due to some confusion in the original question. GnuWin32 does have an implementation of coreutils for Windows, called Gnuwin32 coreutils , though as mentioned, Gnuwin32 is old/not updated, just not as old/not updated, as unxutils.


How to tell Excel not to evaluate a formula?

Is it possible to tell Excel not to evaluate a cell as a formula?


Example cell entry: -A23


Excel wants to evaluate this as reference to a cell. But the data I am working with has another semantics and is no reference to a cell. How to tell Excel to leave these entries as they are?

windows - How to Print to a Local Printer from the Command Prompt

I have the following scenario:


I have a local printer connected to my Windows 8.1 PC and I would like to print several documents (files with the .txt, .pdf and .doc extensions), from the Command Prompt.


I have tried using the print command documented here. However, it doesn't work. I get no stuff being printed and an error message that says:



"Unable to initialize device DeviceName"



It doesn't matter if I specify the port where the printer is connected or the PC name followed by the printer name.


Is this command still supported in Windows 8.1? How can I solve this problem?

windows - How to interact with command-line program using batch file?


I would like to write a batch/cmd script to pass arguments to another command-line program.


However, I'd like to display the output of that program in the batch file, and be able to interact with the program normally.


Effectively, the batch file becomes a transparent way to access the program.


How do I do this?



Answer



I couldn't understand the question very clearly but call is the command that comes to my mind. It is an internal command being a feature of cmd.exe as external commands exist as separate executable files, usually in %SystemRoot%\System32 folder.


call command executes other batch files (with .bat extension) within the calling script and may pass arguments to that external executable file assigned as to its parameters.


Moreover, call command may call for label (defined as :MyLabel inside the batch file, and otherwisely intended and working with GOTO command as points or sections in a batch file to switch the execution to, which is an old and might also be a wrong feature) within the script itself without referring to any external batch file.


The command is well documented in an SS64 page, and it's main difference from just calling the other script or executable file without any using any command, say as MyScript.bat or MyExecutable.exe is that it doesn't leave and exit the current script when calling or upon the external script's finishing, keeping it in the current session, and comes back to and continues executing the calling script's following lines, where the call is originated from.


How to search only the filename for a substring in Windows?


Following on from this question, I'd like to know whether Windows Search also shares the same shortcomings, or whether it is possible using Advanced Query Syntax to search for a substring in the filename only, leaving out the extension?


What I mean is, is it possible to search for something like, say, "zip" in only the filename such that the following valid filenames are returned?


zip
has zip
zip.doc
azip.zipx
textzip.txt
has zip text
File.zip.txt
zipper.winzip
File - zip text.zip
this file name haszipin it.txt

The following are invalid filenames since they do not contain the string "zip" in the filename portion, but only in the extension. These should be excluded.


noname
File.xzip
File.zipx
File.azipx
File.bxzip
File name.zip

Answer



You could exclude zip files from the index but I know that isn't really answering your question. I use a freeware program called Everything that lets me choose what files to index and you can use regular expressions in that search in order to get more exact results (like what you're looking for). As far as I'm aware, windows search doesn't allow regular expressions but maybe you can attach a second parameter to the search like *zip*.* && not *.zip Not sure if that's possible though.




Edit: Since I (Karan) just tweaked Codezilla's last attempt posted in chat, it wouldn't be proper to add it as a separate answer. All credit goes to him (Edit: and to Scott as well) for discovering 95% of this search term, which seems to correctly identify the 10 valid filenames and leave out the 6 invalid ones:


*zip* NOT "*.*zip*" OR filename:"*zip*.*zip*"


So it can be done, but not without jumping through hoops. Confirmation of the fact that Windows Search sucks. Couldn't they have simply added proper RegEx support?


xorg - Yellow and gray blend with white on a remote monitor connected with a HDMI-VGA adapter


The problem is that yellow and gray are hardly visible on my remote monitor. For example when I open StackOverflow I cannot see the yellow background of quote blocks and the gray background of code blocks. They just blend with the white background.


How can I fix the way colors are displayed on the second monitor?




  • The remote monitor is Samsung 2043NW and it has only an VGA port.

  • I've experienced this behavior on two different machines: Lenovo Yoga 3 14 and Dell XPS 17 L702X. They were connected using the same HDMI-VGA adapter.

  • Colors are OK when I connect the monitor to Lenovo ThinkPad X230 to its VGA port.

  • I've tried changing the color settings on both the monitor itself and with software tools like xbrightness, xgamma and so on. It didn't work although it looks like a problem with brightness or an invalid gamma calibration.

  • I've experienced this on both FreeBSD (10.3, 11) and Ubuntu (17.04).

  • I've already tried a few different adapters.



Answer



tl;dr


xrandr --output HDMI-1 --set "Broadcast RGB" "Limited 16:235"



Detailed answer


The problem was with the X server. The idea came from this Arch Linux Wiki article about xrandr.


They suggest there to run:


xrandr --output HDMI-1 --set "Broadcast RGB" "Full"

in order to fix colors. It didn't work but I decided to see other options I can change with --set.


On Ubuntu 17.04 xrandr --prop returns:


HDMI-1 connected 1050x1680+1920+0 left (normal left inverted right x axis y axis) 459mm x 296mm
[... some uninteresting properties ...]

Broadcast RGB: Automatic
supported: Automatic, Full, Limited 16:235

[... some uninteresting properties ...]

It turns out that


xrandr --output HDMI-1 --set "Broadcast RGB" "Limited 16:235"

fixed the issue and now all the colors are distinguishable.


Sunday, 27 January 2019

How can I reset all preferences in VirtualBox?


How can I reset all preferences in VirtualBox?


I haven't found the option in the preference window, nor anywhere else in the menu. Reinstalling VirtualBox doesn't seem to reset all preferences.


enter image description here


enter image description here



Answer




How can I reset all preferences in VirtualBox?



Simply delete the hidden ‘.VirtualBox’ directory in your user profile directory (which is referred to as $Home in the below quote from the online VirtualBox manual.



In addition to the files of the virtual machines, VirtualBox maintains global configuration data. On Linux and Solaris as of VirtualBox 4.3, this is in the hidden directory $HOME/.config/VirtualBox, although $HOME/.VirtualBox will be used if it exists for compatibility with earlier versions; on Windows (and on Linux and Solaris with VirtualBox 4.2 and earlier) this is in $HOME/.VirtualBox; on a Mac it resides in $HOME/Library/VirtualBox.


VirtualBox creates this configuration directory automatically if necessary. Optionally, you can supply an alternate configuration directory by setting the VBOX_USER_HOME environment variable, or additionally on Linux or Solaris by using the standard XDG_CONFIG_HOME variable. (Since the global VirtualBox.xml settings file points to all other configuration files, this allows for switching between several VirtualBox configurations entirely.)


Most importantly, in this directory, VirtualBox stores its global settings file, another XML file called VirtualBox.xml. This includes global configuration options and the list of registered virtual machines with pointers to their XML settings files. (Neither the location of this file nor its directory has changed with VirtualBox 4.0.)



Additionally,



enter image description here



source


How to setup Windows XP on Dell Latitude E6400?

I'm going to install Windows XP SP2 on my Latitude E6400 Dell Laptop. However, after I boot from cdrom the message appears:



Windows is inspecting your hardware configuration



Then the black screen appears and it doesn't show any windows form.


Does anyone have idea or solution?

windows 7 - Bad Sectors on Hard Drive


I run check disk pretty regularly on my hard drive, and lately it's been saying that I have some bad sectores (66, to be exact). I've run smartctl and HD Tune. Both tell me that I have bad sectors and the drive is in "pre-fail" stage. The drive is only a couple of years old. How worried should I be?


My drive is a FUJITSU MHW2160BJ FFS G2



Answer



The question isn't "How worried should I be?", it's "Can I worry enough?".


Prepare for the worst. If you aren't making backups make them now. Replace the drive and have it checked by someone else. If they confirm what your software is saying then kudos! You just avoided losing a hard drive. If they say it's fine, rejoice! There we no issues and you were scared for nothing.


Either way you win. The only way you lose is if you ignore it, don't backup, and it fails.


In PowerPoint, is there a way to create a printable version of an animated slide?

I have a presentation that has some moving parts. When printing, it of course shows the parts in their initial state. Is there a way to store a slide that would just show up when printing, not during a presentation, that has arrows that indicate the animated movement?

boot - Is it possible to build a bootable CD Extra (i.e. 1 audio track & 1 bootable data track)?

More precisely, I was wondering if the standards for "CD Extra" and the El-Torito extension to ISO9660 are compatible and allow to create an enhanced CD with one audio track (readable on a CD player) and one bootable track (e.g. linux installation DVD)? Has anybody already tried doing this under linux?

macos - Is it possible to change the speech rate in OS X say command?


say -v Alex "Hello"

Is there a way to change the speed of speech like there is in the speech settings of System Preferences -> Date & Time -> Clock -> Customize Voice?


enter image description here



Answer



Yes, there is. The command


say -v Alex "Hello" -r 200

will cause the voice Alex say "Hello" at a rate of 200 words/minute.


Launching Firefox into “chromeless” mode from command prompt


Does anyone know if there is a way to launch Firefox (3.*) into "chromeless" mode from command prompt?


The end result I am striving for should look like one of those "chromeless" windows that can be created via the window.open Javascript call. However, I would like the initial Firefox window to be "chromeless" right away. I went through the online documentation of Firefox but failed to find anything relevant.


Does this ring a bell for anyone?



Answer



You could create a separate profile in Firefox for your "chromeless mode." To do that open the profile manager:


"\Program Files\Mozilla Firefox\firefox.exe" -ProfileManager

Create a new profile called "Chromeless"



  • Open the profile and hide the navigation and bookmark toolbars.

  • In the Options under Tabs make sure that "Always show the tab bar" is unchecked.

  • Install the Hide Menubar extension to hide the menu bar


Setup a shortcut to launch your new profile:


"\Program Files\Mozilla Firefox\firefox.exe" -no-remote -P Chromeless

Excel 2010 Removing duplicates


I am trying to remove the duplicates items from a big Excel sheet.
I would like to remove all rows that have a duplicate code values (sample below)


Before:


Name     Code
item_01 xxxx01
item_02 xxxx02
item_03 xxxx01
item_01 xxxx03
item_04 xxxx04

After:


Name     Code
item_01 xxxx01
item_02 xxxx02
item_01 xxxx03
item_04 xxxx04

I have played with the "Remove Duplicates" features, but I can't get the result that I want.


Any help?
Thanks



Answer



You've not explained "the result that I want", but I will take a shot at this.


When you select both columns then click Remove Duplicates from the Data ribbon, the below dialog window opens. Remove the check box from the column you DO NOT want the duplicates removed and then click OK.


enter image description here


It results in the example you gave above.


enter image description here


Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...