Friday 31 May 2019

linux - Is it possible to resize a QEMU disk image?


Like the title says: Is it possible to resize a QEMU disk image in Linux? And if so, what happens to the partitions within it? Are they automatically resized as well (doubtful) or is there just a new block of unused space following them?



Answer



From here:



!!! Back up your disk image before trying the below !!!


If you are using a sparse raw image, then do


dd if=/dev/zero of=hdd.img seek=N obs=1MB count=0"

where hdd.img is the raw format image that you want to resize and N is the new size that you want the image to be, in megabytes. To change the units of N, change obs to something else such as 1GB for units in gigabytes (1000x1000x1000).


If you want to resize a raw image but you do not want it to become sparse (you actually want those zeros in the file) then do "dd if=/dev/zero of=image seek=S count=N-S obs=1" instead, where N is the new size and S is the old size (in bytes).


If you want to resize a qcow2 image, this is not yet supported.


this email shows some experimenting with resizing qcow images with a hex editor.


Resizing or growing images in other formats (VMware, Bochs, cow, or cloop) is not supported to the best of my knowledge.


On a Windows host it is possible to resize a raw format disk image using the 'copy' command. You can use qemu-img to convert your existing image to raw format if need be. We will use a temporary raw format disk image that will be appended on to the end of your existing raw format disk image. The size of this temporary image is the size the existing image will be expanded by:


qemu-img create -f raw temp.img 300M

You should then issue the below command - orig.img is your existing raw format image that you want to make larger, temp.img is the temporary image file created earlier, and new.img is the resized resultant image:


copy /b orig.img+temp.img new.img

You will then need to repartition and resize the existing partition(s) and filesystem(s) on the new image. One method of doing this is to boot gparted in QEMU with the gparted livecd iso and the new disk image.





Other links you might want to check out if the above doesn't work:



http://qemu-forum.ipi.fi/viewtopic.php?p=12362
http://kev.coolcavemen.com/2007/04/how-to-grow-any-qemu-system-image/
http://bryan-murdock.blogspot.com/2007/12/resize-qemukvm-windows-disk-image.html
http://www.larsen-b.com/Article/329.html
http://www.brabbel.net/wp/archives/174



osx snow leopard - Overzealous `mv` renamed my /usr/lib folder


I was having a problem where my libiconv.2.dylib file in /usr/lib was corrupt and lots of applications were failing. I got a copy of a friends /usr/lib folder and was going to swap them out. Apparently I didn't think it through well enough because when I issued sudo mv /usr/lib /usr/lib.old it caused some issues. Now Finder won't open, Terminal.app just keeps saying "Illegal Operation" and other stuff like Archive Utility doesn't work. I'm pretty sure that if I reboot my machine it won't start up at all.


How can I rename this back, or rename my friends copy to just /usr/lib (currenty /usr/lib.new)???



Answer



Thanks for the suggestions. I panicked early this morning and dug through every box until I found the OS X DVD. I was able to boot from the DVD directly and then use the DVD's terminal instance to rename the usr/lib/ folder back. I also reinstalled OS X and Xcode developer tools just in case. It boots up fine now, and no more errors about libiconv either.


windows - How can I get the "dir" and "copy" commands to operate on "*.xyz" but not "*.xyz~"?


When I use copy *.txt somefolder\ the system seems to copy all *.txt~ files too, which is not what I want. A similar same effect can be seen with dir:


C:\Users\Paul\Documents\Programs\Proffy>dir *.txt
Volume in drive C is Vista
Volume Serial Number is EC23-AD6B

Directory of C:\Users\Paul\Documents\Programs\Proffy

29/11/2008 13:54 35,821 COPYING.txt
31/10/2009 21:54 1,644 INSTRUCTIONS.txt
06/06/2009 15:57 1,393 INSTRUCTIONS.txt~
04/01/2009 11:59 116 Notes.txt
19/04/2009 16:53 134 README.txt
04/01/2009 12:42 132 README.txt~
31/10/2009 21:30 197 TODO.txt
31/10/2009 19:10 414 TODO.txt~
8 File(s) 39,851 bytes
0 Dir(s) 41,938,862,080 bytes free

C:\Users\Paul\Documents\Programs\Proffy>

How can I get dir and copy to only operate on files that end with .txt and not .txt~?



Answer



My solution was to execute del *.xyz~ prior to my copy *.xyz. Not brilliant, but it works.


microsoft word - Copy and paste without tracked changes in MS Office 2013

I'm copying and pasting from a document with tracked changes to a text-only document. Previously when copying and pasting from such, text that was strike-through (ie, changed) was not copied and did not show up when I pasted. Now, suddenly, it is. How would I get Word to not copy the strike-through text from the tracked changes?


Edited slightly to better define that the problem is occurring when copy/pasting from Word to plaintext.

display - Why does my screen flicker only in Windows 7?

I have a HP 4530S laptop with Windows 7 Ultimate 64 bit. After five to ten minutes of usage, my screen starts flickering. Check the screenshot below.


I have also another OS installed (Fedore 13), but there I never get this flickering.


What could be the possible cause of the screen flickering only appearing in Windows 7? I am using the latest drivers from the HP site.


enter image description here


I am not using any external monitor, it's the LCD of my laptop.


EDIT: I only got this error when I am on battery, when on direct power I did't get this error.

thinkpad - Lenovo T400 - Large amount of memory reserved for hardware

I'm working with a T400 and Win7 32bit. Of course I can't use my 4GB memory. But the performance monitor shows me 1GB reserved memory for hardware.


Is there a way to reduce this? Maybe..turning off some features in the BIOS?


Greets

printing - How can I use CUPS' basic authentication from a windows client?


I've set up a CUPS server, and configured a printer to require a "valid-user". I have set up a Linux user on the box with a password. I've tested that it requires the username/password from a Linux client (Ubuntu). I'm attempting to set up the printer on a windows client, but I can't seem to get it to pass the username and password through to cups.


I've been passing the username and password via the url I add to windows: http://username:password@server:631/printers/MyPrinter


This works on Linux clients, but not Windows. Am I missing something? Is this not a supported feature on Windows? I've also tried a non authenticated printer from Windows, and was able to get that to print.


Let me know if there is any other information needed, I really am stumped.



Answer



Windows supports IPP printing. I usually find it easiest to provide the user in the URL. This will force Windows to try Basic Authentication. e.g., http://user@host:port/printers/PrinterName



  1. Try to add the printer like normal. After a little time the "The printer that I want isn't listed" link should appear.

  2. Select "Select a shared printer by name"

  3. Enter the IPP(s) Printer URL making sure to use HTTP(S):
    Enter the IPP(s) Printer URL making sure to use HTTP(S)

  4. Click Next

  5. If everything is working, Windows should prompt you for the User Name and Password (this will happen regardless if you enter the username and password in the URL or not)

  6. Enter the User Name (again) and Password:
    Enter the User Name (again) and Password

  7. Select the Print Driver as normal. You can use the Microsoft Generic PCL6 or PS class drivers if you do not need the special features of the printer.


Conditioning Statement on Excel

I'm not sure what ifThen statement or condition statement I may need for this one. Any help would be appreciated. I want to make the whole row red if I insert price into Sold column. F2 is my sold column.

Best way to transfer huge files over internet?


I have a set of audio/video files that I want to distribute to about ten people. There will be weekly additions to these sets of files. They are about 125MB total in size. What is the best method to get these files to these people? I found a lot of sites that want users to install some sort of spyware or crapware on their system in order to get the files (eg pando). Ideally, the user would just have a link on their browser they can click. I don't necessarily need these files to be protected from public viewing/downloading. What is a good method to use?



Answer



Dropbox or AmazonS3, 125Mb isn't a lot of data anymore and the speed is limited by the users end connection.


Dropbox is super easy and free for 2Gb, Amazon costs very little see how to use S3


wireless networking - bcm4331 (wifi) doesn't work on FreeBSD 10.1

I've installed FreeBSD 10.1 on my MacBook Pro Mid 2012 (MacBook Pro 9.2). Everything works pretty good, except Wifi interface (bcm4331).


FreeBSD has two modules - bwi-firmware-kmod and bwn-firmware-kmod for Broadcom devices. According to their man pages, both of them don't support bcm4331 device.


Okay, we can think that FreeBSD doesn't support bcm4331, at least yet. But tonight I've looked into bwn-firmware-kmod and bwi-firmware-kmod makefiles, and found that they use b43-fwcutter. You can find Makefile for bwn-firmware-kmod here.


It is an utility to extract firmware from proprietary drivers. When we install bwn-firmware-kmod from ports, he's makefiles downloads proprietary driver from http://downloads.openwrt.org/sources/, extracts firmware from there using b43-fwcutter and builds module using this firmwares.


So the problem is quit simple, bwn-firmware-kmod's makefile downloads broadcom-wl-4.150.10.5.tar.bz2 and works with it.


I've found that Linux supports bcm4331 devices, and I've tested it under Ubuntu 14.04. It works perfect there. Here is some instruction about how to get this device working in Linux using b43-fwcutter: http://linuxwireless.sipsolutions.net/en/users/Drivers/b43/#Other_distributions_not_mentioned_above.


So I think I have to download some another version of proprietary driver, extract firmware from there and use it with bwn-firmware-kmod. But I even don't know if I am right or not in my theories. If I'm right, then I can continue to research source codes, and try to support bcm4331 by myself.


Is there anybody who can help me to make bcm4331 working under FreeBSD 10.1?

windows 7 - What's the point of the UsersDefault profile?


I'm a linux user and don't really know all that much about Windows stuff. I'm changing the default \Users directory and I see that there's a Default user profile at \User\Default that's a hidden link or something. What's the point of this?



Answer



Creating new users copies that data into the users' profiles, therefore it's the "default" settings etc. Here and here are articles about these defaults.


windows 7 - How can I create transparent images in MS Paint?

I want to know how to draw transparent images in Microsoft Paint for Windows 7.


I searched on Google but couldn't find anything for Microsoft Paint in Windows 7.


E.g. I want to draw a star for my application. But I want that when I display it on black background then there should be no rectangular image with a white background and a star on it. It must be a proper star.

networking - Iptables rules seem to be missing packets?

On my home network (192.168.1.0/24), I am trying to use iptables to silently clone all wifi TCP/UDP traffic to/from my Xbox One to my Windows 10 desktop, for packet sniffing via Wireshark.


Due to locational constraints limiting ethernet connections, I'm attempting to do this via two wireless access points that share one network, with their LAN ports being the only Ethernet connection in the setup: |<--[Ethernet To Cable Modem] | \ \ \ | \ \ \ | \ \ \ | _________________________ \ \ \ └--| NETGEAR R6260 | | | | | SSID: TheNewNetwork(5G) | | | | | stock firmware, gateway | | | | ┌--|_192.168.1.1_____________| | | | | ________________________ / / / | ╙|_ PRINTER 192.168.1.14__|/ / / | ________________________/ / / | ╙|_ AMAZON 192.168.1.15__/| / / | ______________________/_ / / | ╙|_ AMAZON 192.168.1.16___| / | _____________________________ | ╙|_ DESKTOPWIN10 192.168.1.10__| | __________________________ | ╙|_ Nexus-5X 192.168.1.13___| | ___________________________ | ╙|_ GALAXY-S8 192.168.1.17___| | | | \ \ \ | \ \ \ | _______________________ \ \ \ └--| LINKSYS E2500 | | | | | SSID: TheOtherNetwork | | | | | Tomato w/ iptables | | | | |_192.168.1.2___________| | | | ________________________/ / / ╙|_ XBOXONE 192.168.1.12_/_|/ / / / /


The Linksys E2500 has been flashed with Tomato V1.28 (build 140) and is running the iptables framework. DHCP and NAT are off. The Xbox connected to its unsecured wireless access point (SSID: TheOtherNetwork).


Everything else is on the WPA2-secured Netgear wireless (SSID: TheNewNetwork), per usual. The Linksys IP (192.168.1.2) is static, and the Windows (192.168.1.10) and Xbox (192.168.1.12) IPs are assigned by DHCP reservation on the Netgear, which also assigns non-reserved DHCP addresses to everything else (printer, Amazon Fire TV Sticks [x2], smartphones), and handles the NAT for WAN-bound traffic. This network arrangement seems to work flawlessly for all "normal" use cases.


Originally, I thought I could just throw in some packet cloning iptables rules on the Linksys that match on the Xbox's IP, like: iptables -A PREROUTING -t mangle -s 192.168.1.12 -j ROUTE --gw 192.168.1.10 --tee iptables -A PREROUTING -t mangle -d 192.168.1.12 -j ROUTE --gw 192.168.1.10 --tee ...but finding very few Xbox packets in my Wireshark feed, I decided to dig more into if the rules (that were meant to catch all Xbox traffic) were even getting triggered/matched (since that needs to happen before the ROUTE target even comes into play to get packets to Windows/Wireshark).


So, to get a full packet-triggering-debugging snapshot, I setup similarly-triggered rules for each IP address on the network, with a simple -j ACCEPT target, and with a "catch all" rule at the end of the chain that should trigger no matter what. Then I fired up the Xbox and played a minute or so of an online first-person shooter (which worked fine as far as I could tell from the Xbox).


After a minute, this is what I got from the iptables rule list summary: root@E2500-Host:/# iptables -t mangle -vnL PREROUTING Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 68 ACCEPT all -- * * 192.168.1.12 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.12 408 60499 ACCEPT all -- * * 192.168.1.10 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.10 0 0 ACCEPT all -- * * 192.168.1.1 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.1 0 0 ACCEPT all -- * * 192.168.1.13 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.13 1 351 ACCEPT all -- * * 192.168.1.14 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.14 0 0 ACCEPT all -- * * 192.168.1.15 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.15 0 0 ACCEPT all -- * * 192.168.1.16 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 192.168.1.16 1 344 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0


WHAT?!? One measly packet from the Xbox? I was playing an online first person shooter for a solid minute, with dozens of real-world opponent's positions updated from the server many times per second. (I've read enough on this particular game to expect UDP for this exchange.) There MUST BE more traffic than that between 192.168.1.12 and the outside world, and it MUST BE getting handled by the Linksys router that is running iptables, since the Xbox is only connected to the internet via the Linksys unsecured access point, TheOtherNetwork.


As a possibly-related side note: Other oddities include 0 triggered packets for any inbound traffic to any local IP (although maybe not unexpected for the non-Xbox devices on the other access point), and the fact that it caught so many outbound packets from the Windows desktop, 192.168.1.10 (which again, isn't on the Linksys SSID, so I might not have expected the Linksys to see these).


How is it possible iptables is missing the Xbox packets that allowed the fast-paced online game to function?

Thursday 30 May 2019

process - On Windows, how can I gracefully ask a running program to terminate?


On Unix or Linux, it's easy to gracefully ask a running application to terminate: you send it the SIGTERM signal. If its process ID is 1234, you can simply run kill 1234 or kill -s TERM 1234 or kill -15 1234.


How can I do the same thing in Windows?


If I recall correctly, Task Manager's "End Task" feature (not its "End Process" feature) used to do what I want. But, as of Windows 8.1, it's no longer so gentle; when I use the feature, it causes me to lose unsaved data.


I don't want to write any code in order to do this. If I did, I would ask on Stack Overflow. :)



Answer




Andy E writes that you can use taskkill.exe.


To terminate the process with process ID 1234:


taskkill /pid 1234

To terminate notepad.exe:


taskkill /im notepad.exe

For more help:


taskkill /?

He adds:



The /f switch would force the kill, but not using it just sends the termination signal so the application closes gracefully.



He's right. I tried using taskkill.exe (without /f) to terminate Notepad, and it worked as expected. Notepad asked me whether or not I wanted to save the unsaved text which I'd entered.


I'm using the home version of Windows 8.1. It looks like taskkill.exe came included with Windows at no extra charge. It's in c:\windows\system32.



If you don't want to bother with any of this, simply log out of your Windows user account, then log back in again.



Regarding console applications (e.g. PowerShell), Chris Becke adds:



There is no real way to close console applications gracefully on Windows. They need to support some kind of graceful close mechanism.



windows 7 - How to diagnose computer lockups and freezes?

I built a desktop computer a couple years back with the following specs:



  • CPU: Intel Core 2 Quad Q9300 Yorkfield 2.5GHz 6 MB L2 Cache LGA 775 95W Quad-Core Processor BX80580Q9300

  • Motherboard: EVGA 122-CK-NF68-T1 LGA 775 NVIDIA nForce 680i SLI ATX Intel Motherboard

  • Video Card: Two EVGA 256-P2-N758-TR GeForce 8600GT SCC 256 MB 128-bit GDDR3 PCI Express x16 SLI Supported Video Card

  • PSU: SeaSonic S12 Energy Plus SS-550HT 550W ATX12V V2.3 / EPS12V V2.91 SLI Certified CrossFire Ready 80 PLUS Certified Active PFC Power Supply

  • Memory: Two G.SKILL 4 GB (2 x 2 GB) 240-Pin DDR2 SDRAM DDR2 800 (PC2 6400) Dual Channel Kit Desktop Memory Model F2-6400CL5D-4GBPQ


Since its inception, the machine has periodically locked up, the regularity having varied over the years from once a day to once a month. Typically, lockups happen once every few days.


By "lockup" I mean my computer just freezes. The screen locks up, I can't move the mouse. Hitting keys on my keyboard that normally turn LEDs on or off on the keyboard (such as Caps Lock) no longer turn the LEDs on or off. If there was music playing at the time of the lockup, noise keeps coming out of the speakers, but it's just the current frequency/note that plays indefinitely. There is no BSOD.


When such a lockup occurs I have to do a hard reboot by either turning off the computer or hitting the reset button.


I have the most recent version of the NVIDIA hardware drivers, and update them semi-regularly, but that hasn't seemed to help. I am currently using Windows 7 x64, but was previously using Windows Server 2003 x64 and having the same lockup issues.


My guess is that it's somehow video driver or motherboard related, but I don't know how to go about diagnosing this problem to narrow down which of the two is the culprit.




Additional information re: cooling Regarding cooling... I've not installed any after-market cooling systems aside from two regular fans I scavenged from an older computer. The fan atop the CPU is the one that shipped with it. One of the two scavenged fans I added it located at the bottom tower of the corner, in an attempt to create some airflow from front to back. The second fan is pointed directly at the two video cards.




SpeedFan installation and readings Per studiohack's suggestion, I installed SpeedFan, which provided the following temperature readings:



  • GPU: 63C

  • GPU: 65C

  • System: 76C

  • CPU: 64C

  • AUX: 36C

  • Core 0: 78C

  • Core 1: 76C

  • Core 2: 79C

  • Core 3: 79C




Update #3: Another Lockup :-( Well, I had another lockup last night. :-( SpeedFan reported the CPU temp at 38 C when it happened, and there was no spike in temperature leading up to the freeze.


One thing I notice is that the freeze seems more likely to happen if I am watching a video. In fact, of the last 5 freezes over the past month, 4 of them have been while watching a video on Flickr. Not necessarily the same video, but a video nevertheless. I don't know if this is just coincidence or if it means anything. (As an aside, each night before bedtime my 2 year old daughter sits on my lap and watches some home videos on Flickr and, in the last month, has learned the phrase, "Uh oh, computer broke.")




Update #4: MemTest86 and 3DMark06 Test Results:


Per suggestions in the comments, I ran the MemTest86 overnight and it cycled through the 8 GB of memory 5 times without error. I also ran the 3DMark06 test without a problem (see my scores at http://3dmark.com/3dm06/15163549).


So... what now? :-)


Any further suggestions on what to check? Is there some way to get a stack trace or something when the computer locks like that?


Resolution


I have never did figure out the particular problems, but based on the suggestions here and elsewhere, I'm presuming it was a motherboard issue. In any event, I recently upgraded my system, buying a new motherbeard, PSU, CPU, and RAM, and that new rig has been working splendidly the past several weeks. I am using the same graphic cards as in the old setup, so I think it's safe to reason that they weren't the cause of the problem.

networking - How to show TCP listenings and filter them by local IP on Windows?

Server has numerous IP addresses, set up on it's network interface.


How to find, who is listening to specific IP port 80?


netstat shows very long list. Are there any builtin means?


UPDATE


Also can't use findstr with also wishing to know process name because brocess name is displayed on separate line.

command line - Create permanent DOSKEY in Windows cmd


I think the title is pretty self explanatory.


The question is how can I create an alias in a Windows cmd that will also work after I close and then reopen it. For example I would like an alias called ip to call the command ipconfig or an alias ls -l to call Dir.


My operating system is Windows 10, in case that makes a difference.



Answer



Create a macro definition file, for instance in notepad; name it at will and save it anywhere (for instance, in next example I used filename macros.doskey in d:\bat\ folder).
Alternatively, doskey /macros>d:\bat\macros.doskey command will list all current macro definitions into d:\bat\macros.doskey file.
A sample macro definition file could be as follows (note that ==> is my command prompt specified by prompt $Q$Q$G$S command):


==> type d:\bat\macros.doskey
ls=dir /B $1
ip=ipconfig $*

Then, next commands should do the job:


==> reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "doskey /macrofile=\"d:\bat\macros.doskey\"" /f
The operation completed successfully.

==> reg query "HKCU\Software\Microsoft\Command Processor" /v Autorun

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Autorun REG_SZ doskey /macrofile="d:\bat\macros.doskey"

For explanation, read cmd /?:



If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, they are executed first.


HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

and/or


HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

Disclaimer: some AutoRun settings could eventuate in unlooked-for unwanted behaviour, e.g. as decribed in Hidden gotcha: The command processor’s AutoRun setting


Read Save and restore macro definitions; you could prepare a valid macros.cmd script file in one step:


==> >macros.cmd (@for /F "delims=" %G in ('doskey /macros') do @echo DOSKEY %G)

==> type macros.cmd
DOSKEY ip=ipconfig $*
DOSKEY ls=dir /B $1

==>

Please keep in mind that you cannot run a Doskey macro from a batch file.


How to tell from what Ubuntu or Debian repository a package comes?


On a Debian-based system, including Ubuntu, how can one tell which repository a package will be downloaded from, without actually beginning the download? aptitude show and apt-cache info will show the section (e.g., metapackage, base, graphics), but not the repository to which a package belongs (e.g., http://ppa.launchpad.net/mactel-support/ppa/ubuntu or http://us.archive.ubuntu.com/ubuntu/).


When installing the package, the actual repository appears during the download (it is printed out in the "downloading from ..." output from apt and similar programs), but how can one obtain information on the repository containing the package (or a specific version of a package) without downloading and installing it first?


Additionally, how can one determine the source repository for a package that is already installed?



Answer



I run apt-cache policy :


$ apt-cache policy wajig
wajig:
Installed: 2.1
Candidate: 2.1
Version table:
*** 2.1 0
100 /var/lib/dpkg/status
2.0.47 0
500 file:/home/wena/.repo_bin/ squeeze/main i386 Packages
500 ftp://ftp.is.co.za/debian/ squeeze/main i386 Packages

That means that there are three wajig packages:




  • One that is installed (/var/lib/dpkg/status)




  • One that is available from a local repository (file:/home/wena/.repo_bin/)




  • One that is available from a remote repository (ftp://ftp.is.co.za/debian), which also happens to have the same version (2.0.47) as the one in a local repository






Additionally, apt-cache madison will display similar information in a tabular format.


 wajig |        2.2 | mirror://mirrors.ubuntu.com/mirrors.txt/ precise/universe amd64 Packages
wajig | 2.2 | mirror://mirrors.ubuntu.com/mirrors.txt/ precise/universe Sources

windows - QoS or something else?

When running a bit-torrent client I find that it uses all my available ports(right term?), such that I can't surf the internet or get any response from web apps. This is not a bandwidth issue as I have 15Mbps and even if only a fraction of that is in use from uTorrent, this problem will still happen if I'm connected to enough peers. I know about the bandwidth and connection # caps in uTorrent, but I don't want these set low all the time, and the connection # seems to need to be really low to get the browser to work.


I've read a little about QoS and dd-wrt but is that the best solution for this, or is there a windows software solution? I basically just want uTorrent to take a back seat to anything else (browser, netflix, xbox, etc.)


Any ideas?

audio - Bluetooth headphones: great quality on iPhone, poor quality on notebook and PC


I recently got a new pair of Sony MDR-1RBT Bluetooth headphones. On my iPhone 4, they sound fantastic. But when I try to use them on my Windows PC or 2010 Macbook Pro, the sound quality drops substantially. I'm pretty sure they're still using the A2DP profile, but they sound like FM radio, or like an MP3 encoded at 64kbps. (I don't think they're pairing in headset mode.) On OSX, many people have recommended changing the "bitpool" setting, but this didn't help me much. There's also maybe a second of lag, so gaming is out of the question.


I remember having these sorts of problem with Bluetooth 5 years ago, and I'm shocked that they still haven't been fixed. Am I missing something? Why does my dinkly little iPhone play wireless audio so well while my powerhouse computers do not? Is this adaptor dependent? Can I just force Bluetooth to send the highest quality stream possible at the expense of latency?



Answer



I managed to fix the audio on my 2010 Macbook after fiddling with the bitpool settings a little more. For future reference, here's what you need to do:



  1. Go here and download the Hardware IO Tools for Xcode. (You'll need a free developer account for this.)

  2. Open Bluetooth Explorer.

  3. Go to Utilities->Special Options.

  4. Slide the "Minimum bitpool" slider up to 45+. (Mine is set to 50.)

  5. Disable and re-enable Bluetooth.


For the record, my headphones work perfectly fine with my 2011 Macbook at work, so hopefully this won't be an issue with Apple's newer laptops.


On my Windows PC, I'm guessing the issue is my crappy Bluetooth adapter combined with generic drivers.


Search box in Chrome

Is there a plugin to Chrome that adds a separate search box?


I'd like to set the address bar as 'feeling lucky' search, and a separate box for google search. What's especially important to me is having two keyboard shortcuts like in Firefox: Ctrl-K to search, Ctrl-L to feel lucky.

Port-forwarding in router ZTE ZXHN F660: hidden settings

In my company, we have a ZTE ZXHN F660 router, and we need to do a port-forwarding to access a DB allocated in one of our machines through public IP.


We have login into router admin page (visit public ip and login with our user and pass), but our telecom provider seem to be hidden the port-forwarding settings. We just find a few info and settings such as change network name and pass, or disconnect the devices connected to the network.


Is it possible to access the port forwarding of the router another way?


Thanks a lot.

windows 7 - How do I use a Bluetooth-enabled smartphone as a 'Bluetooth Adapter' when it's connected to my PC via USB?


OK, so I bought an All-In-One PC from a wanker who told me it had Bluetooth. It doesn't have Bluetooth. I remember on my old PC I had a USB/Bluetooth Adapter that I could plug in to my PC's USB port and the PC was then able to do Bluetooth magics with other Bluetooth-enabled devices. However, that adapter no longer works (broken) and I've been to Dick Smith, JB, Harvey Norman, Coles, K-Mart, etc and nobody sells anything useful anymore so now I'm wondering if I can plug my phone into the PC's USB port and use the phone as an 'adapter' for Bluetooth, thus enabling the PC to have above said Bluetooth magics. Is this possible, and how would I go about doing this?



Answer



Technically this is impossible, since the phone won't allow this kind of access to the bluetooth-hardware on it. However, if you have a special use-case there might be a solution in the shape of an app for your smartphone that handles it (I can help you look if you tell me this use-case and the phone you use)


If you want native usb support for your laptop you'll have to find and buy a Bluetooth dongle I am affraid.


I would suggest to look for them online on eBay. They'll probably be cheap but have a long delivery time (it depends on where you live I guess...)


If I would be you I'd avoid the China/Hong-Kong ones.


Good Luck!


battery - Windows 7 hibernates by itself

I have Windows 7 Pro 64-bit installed on a Lenovo Thinkpad X120e, and it is set up so that it will go into hibernation when the battery is too low. Sometimes, the computer hibernates by itself, and when I boot it again it tells me that it hibernated because of low battery. The problem is, the battery is not low or damaged or anything. What can be the problem?

How do I get the number of frames in a video on the linux command line?


I have a video file and I want to get the number of video frames that are in it. I can use ffmpeg to get the length of the video and the FPS. However I can't see anything obvious for the total number of frames.


In theory one should be able to multiply the length (in seconds) by the FPS to get the number of frames, but in this case the length (34.43 seconds) and the framerate (29.97 fps) give a non-integer, which makes me think I'm doing something wrong.


I need to be able to do this on the command line in a totally automated and non-graphical manner. I also need this to be pretty exact, and not an estimate (if that's even possible with video files)


I tried using tcprobe on some files. For some AVI files it works, but for some VOB files, the tcprobe output doesn't have the number of frames. I get this output:


[tcprobe] MPEG program stream (PS)
[tcprobe] summary for myfile.vob, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
aspect ratio: 4:3 (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
PTS=2199.3972, frame_time=33ms bitrate=7000 kbps
audio track: -a 0 [0] -e 48000,16,5 [48000,16,2] -n 0x2000 [0x2000] (*)
PTS=2199.2763, bitrate=192 kbps
-D 3 --av_fine_ms 20 (frames & ms) [0] [0]

Answer



This is horrible, and stupid, and slow, but seems to work:


ffmpeg -i foo.avi -vcodec copy -f rawvideo -y /dev/null 2>&1 | tr ^M '\n' | awk '/^frame=/ {print $2}'|tail -n 1

It will also work right on truncated files and raw streams(that is why you get nothing for .vob files)


bsod - Windows 7 64bit STOP Error Code 0x000000F4

I got a BSOD when my computer was almost idle (only uTorrent was running) with stop error code 0x000000F4.


Also at the blue screen it got stuck at the 2nd step (I don't remember what it says) and as a result I don't have a minidump file.


My pc specs are:



  • Motherboard: ASUS Rampage III Extreme

  • CPU: Intel Core i7 950 @ 3,00 GHz

  • RAM: 3x2GB @ 1866 MHz

  • Windows Drive: 60 GB SSD (OCZ Agility)

  • OS: Windows 7 Ultimate SP1 64-bit


This has happened quite a few times during the one year I have this computer. The previous times the Corsair F60 SSD I had stopped working (2 SSDs dead).


The problem is that I cannot reproduce the problem so that we find out the cause. Is it something with the controller of the motherboard? What should I do?

How can I enable multiple users login at a time in remote system?

Recently we bought dedicated server with Windows Server 2012 Standard.It's allowing 2 people at a time.So I want to allow more people at a time.


How can I do this?

blu ray - What is the lifespan of DVD and Blu-ray discs?


Given that they are protected from light, humidity and excessive heat & cold, what is the lifespan range of DVD and Blu-ray discs?



Answer



DVD


According to the Optical Storage Technology Association (OSTA), "manufacturers claim life spans ranging from 30 to 100 years for DVD, DVD-R and DVD+R discs and up to 30 years for DVD-RW, DVD+RW and DVD-RAM".


Blu-ray


The recordable media used in red laser disc technology like DVD's and CD's is an organic dye that is very sensitive to light. Blu-ray disks, however, use a combination of silicon and copper which is bonded during the burning process, this alloy is much more resilient than the organic dye. Manufacturers claim a life span from 100 up to 150 years for Blu-ray disks.


= However, these media don't exist long enough yet to confirm or reject those claims. So at the moment, it's "about as long as the oldest working DVD/BD is still working". These claims are made assuming the disks are stored properly. (Not too hot, dark, not too humid, etc.) Furthermore, these life spans will be averages, I've used DVD disks that stopped working or showed data corruption after 2 years.


Wednesday 29 May 2019

scanning - How to verify scanned page count and quality when using sheet feeder?

I would like to scan old text documents, and then destroy some of the originals. There would be a few thousand sides of A4.


To do this I will need some procedure to "QC" that all the pages have been scanned, and that the scanned pages are readable.


Is there any way to do this other than spot checks?

networking - MAC address spoofing not working in Windows


In Windows 7 I tried setting my MAC address by changing it via adapter properties (Locally Administered MAC Address), but ipconfig /all still shows the old address, even after rebooting. Any hints?



Answer



It's possible your card does not support changing your mac address.


You may also have more luck with a mac address changing utility.


Edit: It seems things are slightly different on Windows 7


(Taken from a forum post);



  1. Go to Control Panel->Device Manage->Network Adapter->Advanced->Network Address

  2. Change the value here. Ensure the first two digits are not the same.

  3. Change the registry key value. (Guide here).


64 bit - Run an application only compatible with 32-bit on 64-bit machine

Title's pretty explanatory. I have an application(Second Life) that isn't compatible with 64-bit windows 7. It says that it is compatible with Windows XP, Vista, and 7 but only the 32-bit version of 7. I need to know if it's possible for me to download something to make the application compatible with my computer. I've run troubleshooters and ran it as windows compatible XP service pack 2 and tried again with service pack 3.

windows 7 - Force turn on file and printer sharing


I am trying to set up File sharing on a friend's machine who is using Windows 7 64 bit Ultimate edition. In advanced sharing settings, I select the radio button "Turn on file and printer sharing" and click on Save Changes. But when I come back to the screen, it reverts back to off.


I searched on the net and found many people facing similar issues, and I tried many steps like turning off WIndows firewall, netsh command, checking predefined rules in Firewall, starting the Server service and HomeGroup Listener service, verifying all required services are started, group policy editor, running the troubleshooter, etc, but nothing seems to be working in my case.


I am not able to see this computer in the Network Places, even though Network Discovery is on. The computer is connected to internet using a wireless connection. The HomeGroup troubleshooter says "Some Homegroup problems are network related" but the network troubleshooter does not find any problems.


Is there no tool to forcibly turn this setting on?


Will really appreciate any help on this. Already spent a lot of hours on this simple yet nagging issue.


Thanks.


EDIT 1:


I remember having turned off SMB through DriverPack online tool, while installing the drivers. Could that be the reason? If so, how can I reenable it without having to reinstall OS?



Answer



My issue finally solved after several hours, without requiring to reinstall OS or go back to a previous restore point.


The sequence of commands which did it are given below. I ran them in Windows PowerShell (right click->Run as administrator)




  1. Enable SMBv1 on the SMB server:


    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 1 -Force




  2. Enable SMBv2 and SMBv3 on the SMB server:


    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 1 -Force




  3. Restart computer




  4. Enable SMBv1 on the SMB client:


    a) sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi


    b) sc.exe config mrxsmb10 start= auto




  5. Enable SMBv2 and SMBv3 on the SMB client:


    a) sc.exe config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi


    b) sc.exe config mrxsmb20 start= auto




  6. Restart computer




All the above commands are given in the Microsoft KB 2696547 article: https://support.microsoft.com/en-ie/help/2696547/how-to-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and-windows-server. I had tried these commands earlier too, but missed to run the commands 4 and 5 above for the SMB client. Now after running all the commands, the issue is resolved!


Hope someone finds it helpful, and saves a few hours of time and endless frustration.


How can I cache all pages I visit with Firefox?

Q: How can I cache all pages I visit in a given session with Firefox?


I frequently go to study with my laptop at a library where I don't have internet access (no login). I usually research somethings in the internet the day before and I wanted to make Firefox cache all data from the webpages so that when I'm at the library I can go back to something I read on the internet.


I have these config settings:


browser.cache.check_doc_frequency;3  
browser.cache.disk.capacity;500000
browser.cache.disk.enable;true
browser.cache.disk_cache_ssl;true
browser.cache.frecency_experiment;4
browser.cache.memory.enable;true (should I set this to false?)
browser.cache.offline.capacity;512000
browser.cache.offline.enable;true
browser.cache.disk_cache_ssl;true

Even clearing all my cache before, some elements, like images, for some reason are sometimes not stored in the cache, even though they display fine on the tab when the page loads. But if I reload the page, they are stored.


There's an Addon called Session Manager that allows me to save the current session. But it would be best if I could save the whole history, because sometimes I forget to store some page I read that turns out to be important. That's why I want to cache everything (disk space is not a problem), so that in "offline mode" I can go back to them in Firefox.


There are related questions, but they don't provide my solution:
Auto save all visited pages in Firefox
Browse local copies of websites when possible (Firefox with slow internet connection)
Browsing cached pages with no internet connection


Thanks!

How to create "curtain" ("barn doors") and "circle wipe" effects in FFmpeg?


I was trying to create two effects by using FFmpeg: "curtain" ("barn doors") and "circle wipe" but had no success. The basic idea is to start from black screen (100% of black padding) and during 1 second (or more) display the entire video (the black padding on the top and on the bottom should get less and less).


Demonstration


How can I do this?



Answer



Generally, there are two methods to achieve such effects.


#1


Create a grayscale animated mask and attach that as the alpha channel to the video. Perform an overlay of the video over a black canvas.


Pros: one-time op to generate the mask. Much faster than method 2.
Cons: Animation parameters like size, speed, duration are fixed. These can be tweaked within ffmpeg but results may not be smooth. Mask file needs to be kept and accessible.


#2


Use the blend filter with a blank canvas as bottom layer and set expressions to carry out the effect.


Pros: customizable. May need some trial and error to achieve exact effect.
Cons: much slower than method 1. At smaller resolutions, result is coarser than a properly anti-aliased mask. If you don't remember expressions or how they work, expressions have to be saved as well and tweaking may be hard.




That said, here are the two effects using the blend filter. Both effects start at 2 seconds and happen over 3 seconds.


Curtains, unveiled vertically


ffmpeg -i in.mp4 -filter_complex \
"[0]format=yuv444p,split=2[bg][v];[bg]drawbox=t=fill[bg]; \
[v][bg]blend=all_expr='if(lte(2*abs(Y-H/2)/H,(T-2)/3),A,B)',\
format=yuv420p" \
out.mp4

A faster method can be adapted from first command here. That command does it horizontally.


Circle Wipe, expanding


ffmpeg -i in.mp4 -filter_complex \
"[0]format=yuv444p,split=2[bg][v];[bg]drawbox=t=fill[bg]; \
[v][bg]blend=all_expr='if(lte(sqrt(pow(X-W/2,2)+pow(Y-H/2,2))/sqrt(pow(W,2)+pow(H,2)),(T-2)/3)/2,A,B)',\
format=yuv420p" \
out.mp4

How can I change the "licensed to" in visual studio?


I'm not sure how it happened, but on startup my VS 2012 copy reads


Licensed To: "----------------Hewlet-Packard (blah)..."

I have no idea how that got there. We installed through our MSDN subscription. Anyone know of a simple way to replace this with either my name or my company's?


This makes me sad inside.



Answer



For Windows 7 I found the following instructions on this site:





  1. Open Registry Editor (Start->Run->type “regedit”->press enter)




  2. Find the following key: HKCU\Software\Microsoft\VisualStudio\11.0_Config\Registration\UserName




  3. Change it’s value to the desired name




  4. Navigate to the following folder: C:\Users\{YOUR_USER}\AppData\Roaming\Microsoft\VisualStudio\11.0 (replace the placeholder with your own username)




  5. Delete the file vs000223.dat – this is actually a JPG file containing the splash screen, you can change it’s name to see it for yourself




  6. Start Visual Studio, and it magically recreates the file with the modified name in it!





windows 7 - How do I disable microphone volume auto-adjusting?

My coworkers started yelling at me today because apparently I started screaming in their ears during a Google hangout. And sure enough, when I go to the Microphone settings dialog, I can see the level being auto-adjusted constantly; sometimes way too high.


I don't think this has happened previously; at least nobody ever complained. Can I find out who is doing that auto-adjusting, and more importantly, can I turn it off? I couldn't find any related setting in the recording device settings.


I'm using Windows 7 64bit, and (I'm mentioning this because the theory has come up that it may be related) I don't have Skype running.

ip - Minimum size of the data part of TCP segment


My question has two parts:




  1. I know that the "data" part of an Ethernet frame can be 46~1500 bytes. Considering the IP header of 20 bytes + TCP header of 20 bytes, the minimum "data" size of a TCP segment should be (46-20-20) = 6 bytes. Considering the UDP header of 8 bytes, the minimum "data" size of a UDP segment should be (46-8-20) = 18 bytes. So, can anyone explain why the lower bound of application data size becomes a high value like 6 bytes or 18 bytes; not a small value, like 1 byte? I believe I am missing something.




  2. I found a couple of explanations[1][2] that the minimum size of an IP packet should be 64 bytes. I think the explanation in the above links are correct. In that case, why is not the minimum "data" size of an Ethernet frame (64-20-20) = 24 bytes?




Can anyone explain this more clearly?



Answer



The minimum frame size for Ethernet is dictated at 64 bytes (as also described in your references).


DMAC + SMAC + EtherType + Payload + CRC  
6 + 6 + 2 + 46 + 4 = 64

At layer 4 (TCP or UDP) the 'length' covers the layer 4 header and it is tracked in the IP header.
This means, for UDP the minimum expected is 8 bytes (for its header). And, for TCP it is 20 bytes (the minimum TCP header).


The part you seem to be missing starts now.
While the Ethernet data length is required to be a minimum of 46 bytes, the IP length does not have to be 46-20 bytes. It can be much lesser than that.


So, if we had a 8 byte UDP packet with no data at all, its IP length would be 20+8 but the Ethernet payload length will still be 46 bytes. What happens to the 18 byte hole? It is padded to make the Ethernet frame on wire 64 bytes (for reasons you already know).


[Eth: DMAC + SMAC + EtherType + [IP: Hdr + [UDP: Hdr + 0data ]] + PAD + CRC ]

Bottomline: What you refer as the application data size has no minimum expectations based on this 64 byte Ethernet requirement. The PAD will compensate for any differences.


iphone - Fastest way to bluetooth tether a phone in Windows 8


As a web developer, connecting my laptop computer to the internet via bluetooth with my iphone is something I do several times a day. Is there an easy way to do this in Windows 8 that I'm missing? It seems like the sort of thing that would be perfect in the charms menu somehow.


After it is paired, currently I:



  1. Go to control panel

  2. Search for "Devices and Printers"

  3. Click on the iPhone icon

  4. Click on "Connect Using"

  5. Click on "Access Point"


I have pinned "Devices and Printers" to the task bar, but this doesn't survive OS restarts, which is annoying. Also it seems like an ugly way to do it.



Answer



In "Devices and Printers", right-click the iPhone and select "Create Shortcut". It should create the shortcut on your desktop.


You can right-click it and connect via that shortcut.


Tuesday 28 May 2019

laptop - Samsung Series 5 BIOS not detecting any bootable devices


so I have a problem with my BIOS, it doesn't detect any bootable devices from the Boot tab.


NOTE: I'm gonna refer to keys and tabs that show in my BIOS settings page for ease of explanation. Please refer to the images below to see such tabs/keys.

So here is what happened:


I have a Windows installation in my HDD. I was trying to install Ubuntu from a USB drive, it showed up when I pressed F10 (key in this computer to select the device to boot from) but it wouldn't boot from the USB just like that, so I entered into the BIOS settings and in the Advanced tab I read on the right that by disabling Fast boot mode legacy USB is supported, so I disabled it, saved and reset. But it wouldn't boot anyway, I played around with some settings but nothing had changed to this point... even though I couldn't boot from USB, my Windows was still booting from my HDD.


But in one of those times I was changing settings, I mispressed F9 (loads optimised defaults) instead of F10 and hit enter, and from here I can't see ANY bootable devices under the Boot tab and now I can't even boot Windows anymore, as well not from my USB either. When I power on my laptop, it just shows the Samsung splash and it enters in the settings page by itself.


Can anyone please help me get my bootable devices found by the BIOS again? Thanks in advance!!


Here is my current BIOS settings:


SysInfo tabAdvanced tabBoot tabno boot devicesno bootable devices on F10



Answer



OK I figured it out.


Under the Boot tab I needed to Disable Secure boot, this added an option to choose a boot option which includes CSM, UEFI and CSM and UEFI. Searching over the web I found that, at least the BIOS version in Samsung Series 5 (not sure if all Series X) does not work quite well with UEFI by itself, but it needs compatibility support.


So by using CSM or CSM and UEFI I was able to get my bootable devices listed again (I still wonder why the maker sets UEFI as an "optimised" default if it's not totally supported).


And by disabling Fast boot mode under Advanced tab, bootable USB is now running!


Anyways, thanks for your help!! :)


terminal - What are the PowerShell consoles for Windows?

Linux is known for having lots of terminals and consoles that are built upon GTK, Qt, GNOME, KDE or X to run the shell (like bash). PowerShell on Windows runs with the Windows console (the same as used for cmd.exe) by default.


What are the other consoles or terminals available for Windows that support PowerShell?

security - How did Google Chrome just update itself when I had forcefully disabled updates and removed Google Update?

Here's the deal -- I just didn't want my Chrome installation to update, for certain reasons that are irrelevant here:



  • I'd disabled Google Update in the Group Policy (yes, I know Chrome ignores it)

  • I'd disabled the Google Update services

  • I'd uninstalled Google Update (not that Google was honest enough to make this work, but still)

  • I'd even removed the Google Update program files in C:\Program Files manually


...and this was working for many weeks... until yesterday!


Until yesterday, Chrome kept nagging me with its usual Chrome-is-out-of-date and Chrome-is-broken-please-reinstall popups. And if I tried to manually update Chrome, it failed -- it gave error 0x80040154. So I knew I was doing something right (or wrong, depending on your point of view).


But today morning I woke up only to find that Chrome had magically updated itself, which drove me very angry and confused at Google. So in one sentence, here's my question:


How did Google force-push an update to my Chrome despite my actions?


Some follow-up questions that are on my mind right now:


Is this in the Chromium source code somewhere, or is it a Google Chrome-specific feature?
Is this a well-known capability? Has it ever been publicized before? Has Google acknowledged it?
From my perspective it seems quite dishonest to "backdoor" this so slyly, and I didn't know they would.
Heck, is someone at Google monitoring my installation or something?

How do I join two worksheets in Excel as I would in SQL?


I have two worksheets in two different Excel files. They both contain a list of names, id numbers, and associated data. One is a master list that includes general demographic fields, and the other is a list that only includes name and id, and an address. This list was pared down from the master list by another office.


I want to use the 2nd list to filter the first. Additionally, I want the results to include other fields from the master worksheet alongside the address fields from the second worksheet. I know how I could do this very easily with a database inner join, but I'm less clear on how to do this efficiently in Excel. How can join two worksheets in Excel? Bonus points for showing how to do outer joins as well, and I would greatly prefer knowing how to do this without needing a macro.



Answer



For 2007+ use Data > From Other Sources > From Microsoft Query:



  1. choose Excel File and select your 1st excel

  2. choose columns
    (if you don't see any list of columns, make sure to check Options > System Tables)

  3. go to Data > Connections > [choose the connection just created] > Properties > Definition > Command text


You can now edit this Command text as SQL. Not sure what syntax is suported, but I tried implicit joins, "inner join", "left join" and unions which all work. Here is a sample query:


SELECT *
FROM `C:\Users\Peter\Documents\Excel-to-excel\Source_1.xlsx`.`Sheet1$` a
LEFT JOIN `C:\Users\Peter\Documents\Excel-to-excel\Source_2.xlsx`.`Sheet1$` b
ON a.col2 = b.col2

windows 8.1 - Why does explorer.exe has an established connection to a microsoft server?

This seems a bit odd. Using netstat -a -b -n I've found the following:


TCP 192.168.1.X:1150   157.56.124.76:443 ESTABLISHED [Explorer.EXE]

It turns out that the ip 157.56.124.76 which resolves to db3wns2011017.wns.windows.com is a static ip from Microsoft.


Moreover, using tcpView from sysinternals I can see that it's a TCP connection over https.


I tried closing the connection and after a second it was back on. Initially a kb of data was sent and nothing after that..


What is this all about and why is it Established?


I have windows 8.1 enterprise. I don't have OneDrive or any other microsoft cloud stuff installed. This is persistent, and is there after booting.


update


After finding out that this is related to Windows Push Notifications, I followed the steps here to disable such notifications, but the connection remains.

networking - Should or shouldn't I remove the 'Everyone' group from my shared folders?

I'm wondering whether to completely remove the Everyone group from my shared folders. I remember one time I did and it screwed up the machine meaning not even the Administrator account could access anything.


I just want to ensure only my login has access to whatever shared folder I setup. Normally I just add my login but I am just curious about the everyone group...should I remove that to ensure 100% I'm safe on our network?

charts - Creating map of countries colored using country statistics


I want to create a PNG (or GIF) image, with geopolitical map of countries, where each country has color set according to some country statistics (e.g. 'USA' has n, 'Canada' has m, etc.).


Something similar to LogToMap, but there is no need to generate it dynamically and/or being interactive. Data source is external file.



Answer



Just because I think you are probably dealing with log-type data, I'd probably go with R and probably the ggplot2 library.


These two resources should get you started:



There is, of course, also QGIS and GRASS GIS in the open-source full-blown GIS realm. I'm discounting ESRI's ArcMap just based on cost alone.


windows 7 - Forward Ports on Parallels


I have a dev server on port 8080 on my mac, and I'm trying to access it from a clean installation of Windows 7 in parallels.


Ipconfig says my VM's IP address is 10.211.55.3. I can access the mac web sharing service at 10.211.55.2:80/ but not my own webserver (GAE) at 10.211.55.2:8080/



  • Parallels set to Shared Networking and is able to browse the internet fine

  • Firewall is off in both windows and mac

  • I installed bonjour for windows as a few forums said to do. I can then use my-computer-name.local/ but same deal as before, port 8080 doesn't work

  • Tried adding a port forwarding entry of 8080,TCP,10.211.55.3,8080 to Parallels Desktop > Preferences > Advanced > Port forwarding rules



Answer



Can you access your testing server on :8080 from other real machines on your network? It could be that your development server software accepts only connections from your local machine (127.0.0.1 aka localhost).


Putty fails to connect to second VirtualBox VM on Windows 10 Host


I'm running VirtualBox on Windows 10. I have been using PuTTY to connect to my Ubuntu 16.04 VM for some time now. I've finally decided that I want to use Ubuntu 18.xx. So I spun up a new VM and configured it just like my 16.04 VM.


I've added an SSH key and done the whole import -> puttygen -> ppk thing.


I've done that several times over the last 6 months. And I've failed to connect to the second VM every time.


I notice that both VMs have the same IP address behind the NAT, they're both 10.0.2.15. I get that from ifconfig. Is that significant or irrelevant?


I've tried adding a port-forward rule, a bridged-adaptor and a million other things that just didn't work.


Question


What kind of setup do I need to be able to SSH in to both running VMs?


What is my problem?



  • Am I overlooking an obvious connection string?

  • Am I being oblivious to some basic networking principles?

  • Am I not allowed to do this?


Desired behavior


I would like to



  1. Run two VMs at the same time.

  2. Run two instances or PuTTY on my host.

    • One PuTTY will ssh into machine A

    • One PuTTY will ssh into machine B



  3. Run PuTTY on my laptop (same office network as desktop)

    • Point this at either VM.




I swear I am not lazy. I've spent countless hours over the last few months trying to get this to work. It's one of those projects that's a nice to have that I keep coming back to every other month as time permits.


Current behavior


I can use PuTTY from my host machine to ssh into my 16.04 VM. I can use PuTTY from my laptop to ssh into my 16.04 VM.


I cannot ssh into the 18.10 VM from the host machine or from the laptop.



Answer



To connect VMs from host, VMs need a Host-Only network interface. The main goal here is to create two network interface in VM. First network adapter will have NAT network (DHCP enabled by default). This connects VM with outer Internet. Second adapter will be attached to Host-Only interface. This connects VM with host OS for SSH, RDP, Docker or other connections.


Here are the configurations for my setup. These may vary in your system. Change these IPv4 IP addresses as wish but be careful about that the IPs should not conflict with other private networks. The Host-Only network should be in same subnet both in host and guest OS.




  • Host OS: Windows 10



    • Host-Only adapter name: VirtualBox Host-Only Ethernet Adapter

    • Host-Only adapter IP address: 192.168.99.1/24 gateway -- optional




  • Guest OS: Ubuntu 18.10



    • VM name: Ubuntu

    • NAT adapter (eth0): IPv4 -- 10.0.2.15/24 (DHCP) gateway -- 10.0.2.2

    • Host-Only adapter (eth1): 192.168.99.100 (static) gateway -- optional




Let assume Ubuntu VM was installed in VirtualBox. Now follow these commands to configure network in host side. Same steps can be done in VirtualBox Manager Window.




  • Create Host-Only Interface (optional, pre-installed): VBoxManage hostonlyif create




  • Add static IPv4 address (or use ncpa.cpl): VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter" --ip 192.168.99.1 --netmask 255.255.255.0




  • Attach Adapter 1 to NAT: VBoxManage modifyvm Ubuntu --nic1 nat




  • Attach Adapter 2 to Host-Only interface: VBoxManage modifyvm Ubuntu --nic2 hostonly




Start the VM. Open terminal, disable interfaces with sudo ifdown -a command. Add static IPv4 IP address in Host-Only network interface (eth1) by adding these lines in /etc/network/interfaces file:


auto eth1
iface eth1 inet static
address 192.168.99.100
netmask 255.255.255.0

Save that file. Enable all interfaces with sudo ifup -a command. Check if both network interfaces are working with ping 10.0.2.2 and ping 192.168.99.1 commands. If both works then:



  • Install SSH: sudo apt-get install ssh

  • Create ssh key pairs: sudo ssh-keygen -A

  • Start SSH service: sudo service ssh restart


Start putty or any ssh client with user@192.168.99.100 from host side. If Windows firewall will block connections allow 192.168.99.0/24 network in outbound/inbound rules.


Further Readings:



windows - Laptop starts up by itself after being in Hibernate

I have a dual boot Windows Vista Basic/Ubuntu KDE4 compaq laptop.


when I have put the laptop into hibernation from windows I sometimes find that it will turn itself back on.


Any ideas what causes it to come out of windows hibernate?

shutdown - The computer isn't completely turned-off when clicking "Shut Down" in Windows 7?


Until recently I used Windows Vista on my computer. Now I have installed Windows 7. But when I choose shut-down in Windows, the computer isn't turned-off at 100%. The disks are turned off, but CPU-fan is still on and I can't use the "power-on"-button to start the computer, unless I hold it a few seconds to 100% turn off the computer before.


How to fix this?



Answer



If you are using BitLocker, then there is a hotfix for this problem.


See this article:
A computer stops responding during shutdown if BitLocker is enabled on the system drive on a computer that is running Windows 7 or Windows Server 2008 R2


Another possibility from Windows 7 Beta: Shutdown problem



Device Manager, select "IEEE 1394 Bus Host Controllers" group, only contains one device called "VIA 1394 OHCI Compilant Host COntroller" on that click right mouse button and select "Properties", select "Power Management" tab, and finally check the "Allow the computer to turn off this device to save power" box.



In any case, even if you don't have such a device, better test that all possible devices have this power policy turned on.


Monday 27 May 2019

latex - How can I ensure the whole paragraph is in one page in Microsoft Word?

I have a document that is consists of many smaller portions, say paragraphs. What I want is, each of the paragraphs will be in just one page. It will not be broken in two consequent pages. In that case, the whole paragraph/portion will shift to next page.


Is it possible with Microsoft Word or LATEX? This is needed to be done programmatically. Manual edit is not useful.

rules - Awesome Window Manager - Open Chromium Developer Tools on Different Screen Than Chromium


I have three screens. One is for URxvt and VIM, another is for Chromium, Firefox, and Opera, and the third is for Chromium's Developer Tools. Below are the rules I've created in my rc.lua in an attempt to create this behavior. It works if I already have the windows open and I relaunch awesome, but the Developer Tools rule doesn't apply when I hit Ctrl+Shift+I within Chromium to launch the Developer Tools window. Instead, it is treated the same as any other new Chromium window and is placed on the first screen. Even if I comment out the Chromium rule, the Developer Tools window still isn't affected by the rule I setup for it, unless I relaunch awesome.


awful.rules.rules = {
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
keys = clientkeys,
buttons = clientbuttons } },
{ rule = { class = "URxvt" },
properties = { tag = tags[2][1],
size_hints_honor = false } },
{ rule = { class = "Chromium" },
properties = { tag = tags[1][1] } },
{ rule = { class = "Firefox" },
properties = { tag = tags[1][1] } },
{ rule = { class = "Opera" },
properties = { tag = tags[1][1] } },
{ rule = { name = "Developer Tools" },
properties = { tag = tags[3][1] } },
}

Answer



I managed to work around the issue by targeting the windows role instead of the name. I also made the rules more succinct by using rule_any for the identical browser rules.


awful.rules.rules = {
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
keys = clientkeys,
buttons = clientbuttons } },

{ rule = { class = "URxvt" },
properties = { tag = tags[2][1],
size_hints_honor = false } },

{ rule_any = { class = { "Chromium-browser", "Firefox", "Opera" } },
properties = { tag = tags[1][1] } },

{ rule = { class = "Chromium-browser", role = "pop-up" },
properties = { tag = tags[3][1] } }
}

splash - How can I change my BIOS splashscreen?


How can I change my BIOS splashscreen?


I have an AMD Athlon64 PC with Windows 7. I have a MS-7367 motherboard. My BIOS = American Megatrends, Inc. v3.0. (date: 06/06/2007) (got the info from CPU-Z)



Answer



This will not work as the splash screen is saved onto your BIOS. The only way is to flash it across.


I have never tried this, but I am pretty sure that this will work; no guarantees though.




  1. Install WinRAR, a extracting software that has a free trial download, which is all you need.




  2. Hunt around your laptop maker's website and look for a download of the latest BIOS for your laptop. Download it and place it in its own folder.




  3. Right click on the file and choose "extract files" (this is where WinRAR comes in). Extract them and look around for a .gif file; you may need to extract some other files that you just extracted. You can extract almost any .exe file that is in the download.




  4. Go through all the .gif, .jpg, .png files that you found and find the one that is shown when your computer boots up.




  5. Replace the file with a new image file of the same name and extension.




  6. After you have done that, now you have to package it all together. Select all the files, right click, and choose add to archive. Check create sfx archive, then click okay.




  7. Double click on the file you just created!




Warning: I would not reccomend this unless you have something that can restore your BIOS, if such a thing exists.


windows 7 - Does a computer use fewer resources when programs are minimized?


When programs are minimized in Windows 7, do they use less memory and CPU than leaving them maximized?



Answer



Yes. According to MS Support, the working set for a minimised application is trimmed. You can check this yourself with Process Explorer.


Here's a test of a single instance of Firefox 5.0 in Windows 7 x64 with a single tab of the ESPN.com website loaded. Values were read using Task Manager.


type                 not minimised  minimised     diff
------------------------------------------------------
working set 165,752k 163,768k -1,984k
peak working set 169,624k 169,624k N/A
mem (private working set) 121,600k 119,576k -2,024k
commit size 135,576k 133,504k -72k
paged pool 396k 397k +1k
np pool 82k 81k -1k
handles 504 483 -21
threads 34 31 -3
user objects 40 44 +4
GDI objects 71 75 +4

Here's a test of a single instance of Paint.NET in Windows 7 x64 with a few small images open. This app was written in Microsoft .NET unlike Firefox which is almost certainly C/C++.


type                 not minimised  minimised     diff
------------------------------------------------------
working set 125,904k 125,256k -684k
peak working set 217,836k 217,836k N/A
mem (private working set) 61,844k 61,844k 0k
commit size 102,388k 102,384k -4k
paged pool 542k 541k -1k
np pool 59k 59k 0k
handles 741 741 0
threads 19 19 0
user objects 276 273 -3
GDI objects 489 491 +2

Turn one row into multiple rows in Excel

I have multiple items that are available in multiple distribution centers (i.e., a many-to-many relationship). There is currently one row per item, with one column for each distribution center. A cell in the row for item X and the column for distribution center Y is marked with the code for distribution center Y if item X is available there and blank otherwise. An item with multiple distribution centers will have multiple distribution center codes (in their respective columns). So the current sheet looks like:


    |   A    |         B         |*|                      S-AJ                      |
1 | ID # | Description |…| Distribution Centers |
2 | 17 | Ginkgo Biloba |…| | | | | | | SE |
3 | 42 | Ginseng |…| | MP | MS | | NW | | |


Columns C through R contain other attributes of the items, such as UPC code, cost, and price, which are not relevant to this question. My actual sheet has 18 distribution centers, spanning columns S through AJ; I reduced that to get the example to fit into Stack Exchange’s window.


I need to have a single distribution center column, with a single distribution code per row, and then duplicate the rows as needed for items that currently contain multiple codes. The result should look like:


    |   A    |         B         |*|   S  |
1 | ID # | Description |…| DC |
2 | 17 | Ginkgo Biloba |…| SE |
3 | 42 | Ginseng |…| MP |
4 | 42 | Ginseng |…| MS |
5 | 42 | Ginseng |…| NW |


where cells A3:R3, A4:R4, and A5:R5, contain the same information.


The only way I can think of doing this, which would be time consuming, would be to copy the item number into multiple rows; and in the column that has the distribution code I would change code for the item that is available in each distribution center. I will be doing this for 900 items. Is there an easier way to do this?

hard drive - Are partitions to the inner/outer edge significantly faster


Some linux dual/multi-boot tutorials / general partitioning tutorials say that the inner side of a hard disk is faster than the outer side so partitions towards the outside tend to be slower while some say that the exact opposite is true.


Which side is actually faster?


Is the difference noticeable?


How are the partitions physically placed on the disk as compared to the partition listing order-for example gparted shows a logical ribbon layout of the partitions. Are the partitions shown to the left side of this ribbon near the outer or inner edge of the disk physically?


Are there software benchmarks like testing some disk intensive stuff for the first time on identical vanilla installs of the same OS but on different partitions, inner and outer?


EDIT: Links


http://www.dedoimedo.com/computers/dual-boot-windows-7-ubuntu.html ctrl + f for "slower" on this page


Does the order of partitions matter? Says outer side is faster


http://www.pcworld.com/article/255224/how_to_partition_your_hard_drive_to_optimize_performance.html Says inner side is faster


http://partition.radified.com/partitioning_2.htm Says outer side is faster(not about dual-booting)



Answer




Which side is actually faster?



The entire HDD platter assembly rotates at a fixed RPM, so the angular velocity is constant.
The average rotational latency will be the same in all cases, since the angular velocity is the same in all cases.


The outer cylinders have faster linear velocity.
Without zone recording, reading a sector on an outer track would be same as an inner track.
With zone recording (as used on probably all new HDDs), reading a sector on an outer track would be "faster" (not slower) than an inner track.


You seem to be misreading these tutorials. Links #1 and #3 clearly state that reads at the outer cylinders can be faster than the inner cylinders.
In link #1 the "end of the disk" refers to the innermost cylinders.
In link #3 the "early part of the test" refers to starting at cylinder 0, which is the outermost cylinder.
There are no inconsistencies or contradictions on this topic among any of the four links you have provided.


Note that optical discs (e.g. CDs, DVDs) are different from HDDs.
Optical discs use a spiral track (per usable side) that starts on the inside and spirals outward.
HDDs employ concentric circular tracks on each surface. Multiple surfaces have tracks that are organized into cylinders. The outermost cylinder is always numbered #0.



Is the difference noticeable?



That depends on what you're doing.


Since the days of 14" platters, then 8", 5.25" and 3.5", the ratio in track length between the outermost and innermost seems to never exceeded 2:1. A practical reason for not exceeding this ratio could be that more cylinders increases the maximum and average seek times.


Modern drives that employ zoned recording take advantage of the larger quantity of magnetic domains (and faster linear velocity) of the longer track lengths of the outer cylinders. By allocating sectors in each zone to a fixed number of magnetic domains, sectors use a consistent length of track per zone. Since there will be more sectors per track on the outer cylinders, the data transfer rate on these cylinders is now faster than the inner cylinders.


The data rate on the outermost cylinder could be twice as fast as the innermost cylinder. On average you might get a 50% faster data rate on an outer cylinder compared to an inner cylinder.


But this performance benefit is only on the data transfer between the R/W head and the platter. This one data transfer of the sector is only one transfer among several operations that will occur in order to satisfy a read or write request by the OS.
To read data in a random sector the steps that will occur are:



  • The OS will construct an ATAPI read request that is transmitted over the SATA bus.

  • The HDD receives the request and processes the command.

  • A seek is initiated to the the proper cylinder (this delay is called seek time and can consume 10s of milliseconds).

  • Once at the correct cylinder, the correct R/W head is selected, and a search for the proper sector is initiated.

  • On average the search for the proper sector takes about a half revolution of the platter (this delay is aka rotational latency).

  • Once the proper sector is found, the actual sector data is read into a sector buffer (usually SRAM) (this is the only operation that is affected by the outside versus inside location).

  • After the entire sector has been read, the data is validated and possibly corrected using the ECC by the onboard controller. The sector data can then be transmitted to the PC over the SATA bus.

  • The OS receives the data.


Now that is for just one sector.
For an idea of the numerous disk requests/operations to copy files, see this answer


On sequential reads that do not require a seek operation, then the time for R/W of the platter becomes a more prominent item in the total time to perform a disk access. How well you can perceive a reduction of a few microseconds is questionable.



How are the partitions physically placed on the disk as compared to the partition listing order-for example gparted shows a logical ribbon layout of the partitions. Are the partitions shown to the left side of this ribbon near the outer or inner edge of the disk physically?



Usually the first sector (cylinder 0, head 0, sector 0) is placed on the left side of these representations. The graph or bar represents the numerical ordering of sectors, which increments the sector number fastest, then the head number (for track number), and then the cylinder number. This progression travels from the outermost cylinder to the innermost cylinder.


A partition shown on the left side would probably be actually located on the outer cylinders. GParted has property boxes that provide the actual disk addresses (by sector numbers) to verify these relationships.



Are there software benchmarks like testing some disk intensive stuff for the first time on identical vanilla installs of the same OS but on different partitions, inner and outer?



I have no idea.


microsoft outlook - How To Filter On Bcc Info

I've created a rule that checks for messages sent to a distribution list, but I'm finding that the rules is missing messages in a thread where the sender moves the DL address to BCC. Basically, I want to check if my name is not on the To: or CC: fields. How can I write a rule that takes this into account?

recording - Satellite TV on my PC?



What would be a good solution for hooking up the satellite TV box (Dish network) in my room to be able to watch it on my PC and possibly record video from it?


Please share with me the best cards, cables, software, anything else needed to do this in the most efficient way?


I am looking at the WinTV-HVR from Hauppauge. I am not sure, for performance, what would be the best to go with, PCI, PCI express, USB2.0?


Also on the Hauppauge website I saw this note: "WinTV-PVR products will not work in PC systems with 4GB or more of memory." The new PC I am building will be 12-24gb of DDR3 RAM, does that mean their products will not work at all with my memory? So confused now!



Answer



(assumption: the STB and PC are in different rooms, and you're trying to solve both the problem of getting the STB's output from one end of the house to the other, and getting it into your PC for viewing/capture once it's there)


If you have a Dish STB in one room, and want to watch TV from it on your PC, you have very few options... none of which are particularly good.




  1. At the cheap end of the spectrum, you could get a NTSC video modulator. Ugly, non-HD, and just about the worst possible way to get TV from the box to the PC... but also likely to be the cheapest. Assuming you have a 75-ohm coax cable already running between the rooms, you'll basically be looking at a $15-25 video modulator, plus any run of the mill video capture solution at the PC end.




  2. Taking a step up, but still non-HD, if you have a spare cat5 cable running between the rooms, you could get a s-video + analog stereo audio balun. This will probably cost about $50, but will give you MUCH better video quality than the modulator will. As a practical matter, a HD satellite box outputs DVD-quality s-video. If you're planning to watch TV in a small window, the only real downside of this approach is the fact that the 640x360 16:9 letterboxed video will also be interlaced. Yuck.




  3. The next step up involves a cat5 cable and component video balun. Audio is tricky. With a single cat5 cable, you can cheaply send SPDIF, or spend more for analog stereo (I'm not entirely sure how they send analog stereo over a single twisted pair, since the other 3 pairs are taken for Y, Pb, and Pr... I suspect it involves a single-chip FM modulator and tuner at opposite ends). At the computer end, you'll need a component video capture card. Officially, these don't exist in cheap form. Unofficially, I've seen some from China that are about $100-200. I believe Hauppauge has a solution, too. Thanks to Hollywood, you can probably forget about seeing any mainstream consumer-grade products in America anytime soon.




  4. If you can deal with throwing down a few hundred bucks, your easiest option is probably a Slingbox. Put the Slingbox at the satellite tuner, run the software viewer on your PC, and watch TV. In another year or two, it will probably be cost-sane (around a hundred bucks per TV) to buy dedicated boxes that get Slingbox video from your LAN and output it to a TV's component video or HDMI inputs. Right now, this is a pretty expensive option.




windows 7 - What "user" must a scheduled task run as in order to be visible for all users?


I wish a task to be scheduled to run when any user logs on, but is not dependent on any one user being logged on, so I pick "Run whether user is logged on or not". The problem with this is that the program runs hidden (as stated in the docs and queried in this Microsoft Community post), but I need the GUI to be visible.


So, I need to pick "Run only when user is logged on" for it to be visible. But any one "normal" user might not be logged on!


Which user account should I use in order to run this task?


I tried running it as SYSTEM, but that automatically sets the "Run whether user is logged on or not" option - so it will run hidden.



Answer



I just tested this and you can select a "group" for the account.


Pick Run only when user is logged on.


Click Change user or group (it says group right there :)


type in users and click Check Names and Click Ok


and you application will run interactively for all users in the group users.


How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...