Monday, 30 April 2018

"Bad address" error when accessing /dev/clipboard in Cygwin


I like to use /dev/clipboard for moving content easily between Windows and Cygwin's command-line tools. It seems like Cygwin has problems with large clipboard contents, though. I get an error like this when I try to access /dev/clipboard after copying a large amount of text on the Windows side:


$ wc -c /dev/clipboard
wc: /dev/clipboard: Bad address
573440 /dev/clipboard

Is there a fixed buffer size for the clipboard that I can somehow increase? Or is this some other issue entirely?



Answer



I'm not sure why the /dev/clipboard device is problematic for you, but I do know that using the putclip and getclip utilities should be able to handle the job. I regularly use them with multiple megs worth of data and have never run into any trouble.


$ cat large.txt | putclip

$ getclip | wc -c
8665361

They come with the cygutils package... http://cygwin.com/packages/cygutils/


ssh - SFTP server for Windows with its own users and folders?

anyone knows if there's a SFTP server for Windows, with these features?
1. sftp users db is separate from windows users (preferably a simple text file with user/password pairs or some kind of db with gui). I just don't like the idea of creating a full windows user to only use it for file transfers
2. for each user I can specify a home folder manually (could be on different disks)
3. free (as non-paid)


I tried OpenSSH, but it seems to be tied to windows users. Judging by how much time it took me trying to set it up, it would take a lot of time to check all other existing server software so I decided to ask.
As for what I am trying to accomplish - I am trying to set up a server to sync with winscp. Plain FTP is out of question as it's not encrypted, FTPS/ES data connections are blocked by firewall, SFTP utilizes single port and is allowed on our firewall. The problem is, I am too used to filezilla server which had it's own user db and could set specific home folders for each of them, so I want to have the same functionality with SFTP

windows 10 - Apps still blurry after DPI change on Fall Creators Update

So I've updated my Surface Pro 4 to Fall Creators and the much touted fix for high DPI screen doesn't seem to be there.


When I change screen from high dpi to low dpi or back, there is still a red warning in display settings that you need to sign out to fix some applications. When I restart legacy apps they come back as blurry as ever. There's no improvement. If anything the scaling seems even worse than it was (more blurry).


Is anyone else seeing this too?

Disabling doc list when using ctrl-tab in Notepad++


I'Is there a way to disable the "doc list" that is displayed when you switch between documents with CTRL+TAB?


I'm used to editplus, where hitting CTRL+TAB simply switches the document immediately.


This is useful to quickly switch between several documents and find the one you want by content instead of by name.



Answer



Settings > Preferences


Click the MISC. tab. Find the Document Switcher box on the left side. Uncheck Enable.


Your CTRL+TAB now just slides through documents.


Is it secure to post a Windows 7 minidump file online?


I realise it's unlikely that posting the file would cause a problem. However, since I know nothing about what a what's in a minidump file I thought I should check.



Answer



Here is example of minidump http://www.computerhope.com/jargon/w/minidump.txt Content of it is



  • The Stop message, its parameters and other data

  • A list of loaded drivers

  • The processor context (PRCB) for the processor that stopped

  • The process information and kernel context (EPROCESS) for the process that stopped

  • The process information and kernel context (ETHREAD) for the thread that stopped

  • The Kernel-mode call stack for the thread that stopped


More information here http://support.microsoft.com/kb/315263#method1


osx snow leopard - How to show specific hidden file in file browser dialog - Mac OS X


I need to use Automator to backup some of config files in my Mac. But I don't know how to get a hidden file in the file browser dialog. I chose "Get Specified Finder Items" task then click Add, but the file browser didn't show the hidden files I want to select.


How can I get the hidden files I need?


Thank you and have a good day!



Answer



Press Cmd-Shift-. in the file dialog to show hidden files.


proxy - Log Web Traffic on OpenWRT


Is it possible to to log web requests on OpenWRT? I'm pretty sure I could do it on DD-WRT.


What I would like to to see the urls. Would I have to set up a proxy to do that, or does OpenWRT have that option?



Answer



You can try something like this : tcpdump -A -s 0 'tcp port 80' -w logfile.dump, then analyse the output using wireshark.


Please keep in mind that a growing part of the internet traffic is encrypted using https and so you won't be able to decrypt those requests.


networking - Using a Wi-Fi router as bridge to increase the signal?


A friend of mine lives in an appartment building whose structure is such that the Wi-Fi signal is very weak. Even a USB key won't work.


I was thinking of buying an entry-level Wi-Fi router and reconfigure it as a bridge to act as repeater. Would that increase the chance of getting a good signal, or I shouldn't bother? If experience shows that it does improve things significantly, is their another router I should look at besides the Linux-based Linksys models?



Answer



Get a router that can use DD-WRT. DD-WRT firmware works well as a repeater. Meaning that it will be a hop to the "main" router. So your friend will be able to connect to whichever router has the best signal strength for where he is in the apartment. Newegg.com or slickdeals.net will have routers on sale all the time that can run DD-WRT. You should be able to get one for about $30-50 USD.


Note: the router acting as a repeater should not go in the same room (area) as the "main" Wi-Fi router as that will not do any good. For best results you will have to play around with its location but somewhere in between where your friend is using his laptop and the "main" router should be good.


Oh and if you are doing this to steal Wi-Fi , that is just plain wrong and in some cases illegal. =P


ubuntu - SSH Connection refused

I have a mini2440 board that has linux on it. I want to connect to it with a SSH connection from my vmware-ubuntu 11.10. I can ping it. But we I want to connect to it with this command


ssh root@192.168.1.230

I get this error:


Connection refused

I searched the Internet. Someone said: "Install openssh-server". and I installed it. Someone said :"Check if sshd is running " and I checked it. Someone said :"Open port 22 on windows firewall. and I opened it for inbound rules and outbound rules. I need this connection to debug my programs remotely with Eclipse.


But :( But non of them were useful. and I still get this error. Would you please help me? I'm confused.

Force a browser to load the 'https' edition of a website, not the 'http'?


This is similar to this previous question, but I believe it's a bit different*.


Sites like GMail support a preference that pushes all traffic through the SSL edition of the site rather than the plain-text protocol.


For sites that don't offer such preferences (or ones that may, but I have been unable to find, like facebook), is there a way using only the browser (perhaps with a plugin or addon) to always try SSL first, and fall-back to plain-text iff SSL fails?


Is that solution available on Windows, Mac OS X, and Linux? Just one?




* The previous question was looking for external applications that would accomplish this goal.



Answer



Even if you could find such a solution, you'd have the problem that some web servers will always answer https requests, but won't send you to the website's page. Most likely your browser will end up on some landing page of the web server. An application would not be able to distinguish a landing page from the page you actually want. I'd check the similar question for external programs... I'm not sure if you can accomplish this without an external program.


networking - My Mac trying to connect to a possible intruder's machine, that is not in the network anymore


I just asked a question I think someone else has access to my wireless network. What next?. I have changed wireless security to WPA2, changed the password, disabled file sharing etc as =suggested in the answers. I even restarted my modem to that the DCHP leases expire. (Being a old modem, there is no option, at least from what can see, to reset leases)


Now, out of curiosity I downloaded Wireshark to see what is really happening on my network.


I still see 192.168.1.6 doing something on the network. Worse, I see my machine, 192.168.1.2 talking to it!
Wireshark


Now,



  1. How is this possible? The modem's DCHP leases say there is no 192.168.1.6.

  2. Could it be that my Mac somehow remembers a old address and tries to connect to it? Then why is there an response?

  3. Why would my mac connect at all? File sharing is off. Web sharing is off. Is this something to worry about or am I freaking out without reason?



Answer





  1. How is this possible? The modem's DCHP leases say there is no 192.168.1.6.



DHCP just assigns IP addresses. It is completely advisory, and any host may choose its own address with or without DHCP.



2.Could it be that my Mac somehow remembers a old address and tries to connect to it? Then why is there an response? 3. Why would my mac connect at all? File sharing is off. Web sharing is off. Is this something to worry about or am I freaking out without reason?



From what we can see in this part, your Mac initiates a TCP connection and wants to speak NetBIOS. NetBIOS is often used for name resolution, not necessarily file sharing. Your Mac indeed remembered the NetBIOS remote endpoint and now connects to it. 192.168.1.6 speaks NetBIOS, but refuses the connection. That traffic in itself is not a problem.



possible intruder's machine



First, find out the router's IPv4 address. It's probably 192.168.1.1, but if it's .6, the mystery is solved. Then, disable WLAN temporarily and connect via cable. Make sure no other computer is connected, neither via cable nor WLAN (WiFi LED should be off). Then, set a new WPA2 password, first on the router, and then on all machines. Check the IP addresses on all machines connected to the network to make sure 192.168.1.6 is not an ancient file-server in your closet. If you can still detect the intruder (and I'd wager you're facing a misconfiguration, not an intruder - a knowledgeable intruder would probably not speak NetBIOS), ask a new question and make sure your computers are not compromised.


sync - Two identical Macs


I want to sync my iMac with my Macbook, so I'll have a reserve computer if the laptop fails. What's the best way to do it?


Can I have this sync on one profile, and keep working on the iMac as another user?


Thanks!



Answer



Syncing your entire hard drive:


One option, if you're not worried about keeping them both completely up to date at all times is to use Firewire Target Disk Mode (if possible) to clone one hard drive over top of the other using a program such as Carbon Copy Cloner or SuperDuper. The biggest caveat with this would be if the computer is newer than the Operating System currently on the other computer. For example the new iMacs have a custom build of 10.6.1 and won't run as they should if given just regular 10.6.1. However once 10.6.2 comes out it's a moot point.


For more actively syncing your home folder I strongly suggest checking out question 40164: Sharing and Syncing Home Folders. Other alternatives not listed in that thread include applications such as Unison.


Sunday, 29 April 2018

defragment - What does a defrag actually do?

What does a defrag do really? Does it put the files that execute in sequence closer together?

Apache Server on Windows 7 opening up ports?


I have installed Apache 2.2.14 on Windows 7 and can view my web pages using both http://localhost and http://127.0.0.1 but when I try to access the server from another computer on the same router, it fails. It also fails when I use the DynDNS address that I have mapped.


This worked fine under Windows XP before I upgraded to Windows 7.


I suspect the issue is something like port 80 not being opened up for outside access into the computer.


Does anyone know how to open that port up in the Windows Firewall, or if something else is locked down what that is and how to unlock it?



Answer



To add a rule in the Windows Firewall for port 80, do the following:



  • Go to the Control Panel and launch "Windows Firewall"

  • Go to "Advanced Settings"

  • Select "Inbound Rules" in the left pane

  • Select "New Rule" in the right pane

  • In the New Inbound Rule Wizard, select "Port" as Rule Type, then click on "Next"

  • Select "TCP and put "80" (and any other ports you want to open) in "Specific local ports", then click on "Next"

  • Select "Allow the connection", then click on "Next"

  • Select the network location where the rule should apply (select them all if you're not sure), then click on "Next"

  • Give a name and an optional description


That should do it.


gpu - What's the difference between graphics solutions and a graphics processing unit?



I was told to do a presentation on GPU and was told to focus on the major types of graphics solutions, disadvantages and advantages of the graphics solutions and the different features on each one. I'm a programmer and don't know much about hardware so I'm a bit confused here. From my research, a GPU (graphics processing unit) is different from a graphics card (a GPU is part of the graphics card - this is referred to as integrated? and some GPU's are part of the motherboard - this is known as dedicated?).


When I searched wiki, I found this article: https://en.wikipedia.org/wiki/Graphics_processing_unit#GPU_forms


The article talks about GPU forms and mentions "Dedicated graphics card", "Integrated graphics solutions", "Hybrid solutions", "Stream Processing and General Purpose GPUs (GPGPU)" and "External GPU". Are these all different types of GPU's? (I'm asking because the first form is called a 'graphics card', the next two are called 'graphics solutions' and the last two are called 'GPUs'). Are they all different types of graphics solutions?



Answer



What your asking almost belongs on an english language site :-) Is there a proper technical term for a solution? Or did this just get made up from two common words , and would not be any different than saying "connection answer" for a ethernet wire, it just sounds good.


The dictionary definition of the word "solution" that applies here, is "The method or process of solving a problem" Every displaying device built-in or carded or soldered in or even running off the side with a USB connection, would be a solution for displaying grafics.


The dictionary definition for grafics , that applies here is "The process by which a computer displays data pictorally."


Conclusion: They are all "Grafics Solutions". Manufactures may have created , creative and accepted terminology words and word combos, that get adopted and will eventually sound technically more correct, that does not make anyone wrong for calling a shovel "shovel" :-)




Integrated or On-Die - Usually referring to GPUs that exist on the same pcb, more often in the same die (silicon chip) as the CPU. Most of thier ram use will be the same ram modules as the CPU itself is using.


Dedicated (card) - Referring to a carded GPU that sticks in some slot in the motherboard that is a GPU and video memory and frame buffer and video ports, all capable of doing the work somewhat seperated , with fast I/O lines to get the data to them.


Onboard - Integrated as a chip onto the motherboard, usually weak processing capability , intended for displaying more than for huge processing and rendering 3d stuff. Does the job of being able to see.


Dedicated (laptop) - But onboard :-) In laptops the dedicated GPU unit may very well be socketed or soldered direct to the motherboard, or a daughterboard , is usually called dedicated. Even if a laptop has a weak "onboard" or "On-Die" gpu capability for simple displaying, a "dedicated" GPU will be capable of fast processing, and has its own video memory. The final picture (frame buffer) will be sent out to the onboard or on-die gpu for display. The seperate GPU chip that kicks in to do the really hard GPU work is called dedicated in the latptops.
notes: a few laptops have seperate video ports and fully seperated gpu capability.


Hybrid - Combo of having a seperated GPU chip to do processing, but still utalising the normal motherboard ram for the video ram.


External - well anything that can be stuffed on the outside, which includes low end to high end gpus that get thier data i/O from various ports like USB and even PCI/PCI-E ports that are accessable ports on most laptops External could possibly even refer to a dedicated (card) that is slotted into a "docking" type hardware that is external to a laptop providing much of the same capability as a desktop.


Processing unit - stream processing, whatever they want to call it, similar to CPU cards that would drop into a slot and be capable of processing what was sent to them, the GPU processing unit becomming more capable of being used for other stuff other than render and display. To process general code that can be easily parellel processed, code that would previously be cpu processed, that the GPUs parellel many processing units would work well with.


windows - How to recover Virtual Machines in Virtualbox?


For some reason, all of a sudden, all virtual machines are gone from the User Interface in virtual box. I suspect CCleaner has something to do with it, but that's not the point. Both the virtual hardisks and the .xml files for the machines are still in their respective folders. How can I use them to get my virtual machines back into virtualbox?


I tried simply creating a new machine from the old virtual hardisks, and it worked with the ubuntu guest, but not with the windows one. Plus, it'd be nice to get my old machines back instead of having to create new ones, that would keep me from having to fix some shortcuts as well as reconfigure shared folders and other stuff.



Answer



Solved it by manually editing virtualbox.xml file to include the old machine files, then added the hard drives through the User Interface, then modified the machine .xml files to point to the hardrive's uuid.


In fact, the reason the machines were gone in the first place is that I accidentally deleted the virtualbox.xml file.


windows 7 - Error while zipping files with unicode characters in names with Win7's "send to > compressed (zipped) folder"


When I try to zip files containing unicode characters in their names, such as © or ™, I get the following error:



[Window Title] Compressed (zipped) Folders Error


[Content] 'C:\Asd™.txt' cannot be compressed because it includes characters that cannot be used in a compressed folder, such as ™. You should rename this file or directory.


[OK]



This only became a problem when I reinstalled Windows 7. I probably had some resources necessary from this error to be resolved automatically, but it's almost clean installation now and I can't zip files. How do I fix this?


UPD: Some time passed since I posted this question, I installed some of my usual applications, but the problem still exists and I'm not sure if it can be fixed by installing some specific application from before.




Windows 10's built in zipping might not have this problem, as reported in a comment to this question.



Answer



If the offending characters are from a language other than English but one Microsoft supports, you can install the relevant MUI (Multilingual User Interface) language pack from Windows Update, or the relevant LIP (Language Interface Pack) from here as a possible fix.


In addition to the above, you may also need to change the System Locale.



The system locale determines the default character set (letters, symbols, and numbers) and font used to enter and display information in programs that don't use Unicode. This allows non-Unicode programs to run on your computer using the specified language. You might need to change the default system locale when you install additional display languages on your computer. Selecting a different language for the system locale doesn't affect the language in menus and dialog boxes for Windows or other programs that do use Unicode.



To do so:




  1. Type "region" in the Start Menu search box (without the quotes)




  2. Open the Region and Language Control Panel applet




  3. Click the Administrative tab, and then, under Language for non-Unicode programs, click Change system locale. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.




  4. Select the language, and then click OK.




  5. If you're prompted to restart your computer, click Restart now to do so.


    Win7 Change System Locale






However, if the offending characters are something like as mentioned above, I do not believe there's any official Microsoft fix for this zipfldr.dll limitation, that has existed as long as Windows has had this feature (so if you really did fix it earlier, possibly you installed some third party component). From Wikipedia:



Versions of Microsoft Windows have included support for zip compression in Explorer since the Plus! pack was released for Windows 98. Microsoft calls this feature "Compressed Folders". Not all zip features are supported by the Windows Compressed Folders capability. For example, AES Encryption, split or spanned archives, and Unicode entry encoding are not known to be readable or writable by the Compressed Folders feature in Windows XP or later versions.



The ZIP file format lacked Unicde support for a long time, and this extension was only added 6 years ago in 2006. As per APPENDIX D - Language Encoding (EFS) of the ZIP File Format Specification:



D.1 The ZIP format has historically supported only the original IBM PC character encoding set, commonly referred to as IBM Code Page 437. This limits storing file name characters to only those within the original MS-DOS range of values and does not properly support file names in other character encodings, or languages. To address this limitation, this specification will support the following change. [Read document for the rest.]



Since then of course all of the major Windows archivers implementing the format have been updated to include Unicode support, beginning I believe with WinZip in 2008. Unfortunately, Microsoft for some strange reason licensed a third party library for its Compressed Folders feature (although it's not terribly tough to code ZIP support), and obviously this library pre-dates the addition of Unicode to the ZIP file format. Also, as a clear sign of just how much it cares for this feature, Microsoft has not updated the code to fix this bug till date (apparently, even the new System.IO.ZipArchive class in the latest version of the .Net Framework i.e. 4.5 did not get this right initially, but the bug has since been fixed). I guess they expect everyone to install one of the many full-featured third party archivers available, which is precisely what I recommended to you as well above.


You can read the sordid details about this peculiar lack of Unicode support in Windows in the following series of blog posts by Microsoft's Michael Kaplan:





P.S. "I just found out that zipping with windows' "send to" works as good as Winrar's "best" zipping, but so much faster." - I just tested this, multiple times. Other than the extra time taken to open WinRAR's Add to archive dialog, select ZIP as the archive format and press OK, the actual time taken for compression was roughly the same for both, with WinRAR taking less time in general (albeit the differences were negligible). If you saw a huge difference, it could only have been if you tested WinRAR on a set of files first, then immediately compressed the same files with Compressed Folders. Naturally the second time around Windows had already cached the data, so the process took a fraction of the time it did initially. Do it in the opposite order on a set of files you haven't touched earlier during the current Windows session, and I bet the result will be reversed. :)


As for the final compressed size, depending on the data/combination of file formats archived, I found either of the two doing a better job (although again the differences were negligible). Of course, the 7z or Rar (or even WinZip's ZipX) formats are far better in this regard and will beat plain ol' ZIP almost any day (i.e. ZIP using the traditional/legacy deflate algorithm instead of PPMd and the like).


automatic update - How to stop windows from updating?


I have disabled my Windows update feature.


But some how windows downloaded the updates (I think Avast had enabled automatic updates) and it is forcing to to update my Windows 7 or it is going to run automatically 20 Feb at 3:00 am.


enter image description here


How do I stop it from updating?


Thanks.



Answer



To completely disable Windows Updates, make sure to set Windows Update to Never check for updates in Windows Update -> Change Settings, and also to disable the Windows Update service in Services.MSC.


linux - tools for checking hard disk failure


Fedora 13


I am just wondering if there are any tools for checking the life of the hard disk. I had my hard disk for 4 years. And now I think it is having some problems.


Is there any tools I can use to check the condition of the hard disk?


Many thanks for any advice,



Answer



smartctl


Saturday, 28 April 2018

performance - "Task Manager" addon for Firefox?



Are there any addons for Firefox that can replicate the performance monitoring of Task Manager in Windows - seeing memory and CPU used - but for all the tabs in the current Firefox session?


I want to be able to see which tabs are taking up the most memory or hitting the CPU the hardest.



Answer



StatusbarEx is a Firefox extension that will show system information on the statusbar of Firefox, such as the memory usage of system & Firefox itself, network speed, system power status, etc.


Alt text


However, it doesn't work 'tab specific'. since Firefox (unlike other web browsers) is using threads instead of processes to open tabs. I doubt this is possible at all.


battery - Implications of using a laptop always-on as a server


I assumed that there would be a lot of information on this on both the Web in general and on Superuser, but to my surprise I can't find direct answers to these questions about using a laptop as a server.


I have been given an old iBook G4 which I hope to use as a server for a Web and SMS based system that I run (it would run in Debian Linux). I am confused on the following points however:




  • If the laptop is on AC power 24/7 and also has a battery (to keep it running during power cuts), will the battery be damaged? I could not get a clear answer on this from the various sources I found on the net, though the information here and in this SuperUser question implies that this is not a problem except in terms of screwing up the digital calibration. However, I am not sure if this is true if the laptop is also running 24 hours a day (that information seems to pertain to laptops that are charging all the time but not necessarily running all the time).




  • Overheating is clearly a potential risk, as several people warn against. Is there any other risk to laptop hardware from running continouosly, if overheating is guarded against?




  • In sum, if I were to do this for a year or two, and then try to hand over the laptop to someone else to use as a normal machine, would it function well enough for them to do so? Or should I plan on this use as a server on the assumption that it would 1) either die completely or 2) be rendered useless as a laptop after prolonged use?




Edit: Thanks for the suggestion to remove the battery, but that would actually defeat the main advantage of using the laptop (currently the system runs on a GoFlex Home ARM based small computer, but I live in an area with really frequent power cuts, and even though the system is on a UPS it shuts down a lot). So my questions apply to the situation where the battery is in the system.



Answer




If the laptop is on AC power 24/7 and also has a battery (to keep it running during power cuts), will the battery be damaged?



No, but if you want you can remove the battery and run the laptop with only AC, if you are concerned about battery wear.



Overheating is clearly a potential risk, as several people warn against. Is there any other risk to laptop hardware from running continouosly, if overheating is guarded against?



Overheating really isn't a big deal, the worst thing that can happen is that the computer forcibly shuts down when the temperatures get too high. It will not start burning. If there are no obstructions around the laptop, you'll be fine.



In sum, if I were to do this for a year or two, and then try to hand over the laptop to someone else to use as a normal machine, would it function well enough for them to do so?



Removing the battery is a good way to make sure you don't wear that out. Other than that, it depends on the temperature. If you run it with ok temperatures (no more than 50-60 degrees celsius I would say) it shouldn't matter. Make sure the LCD screen is turned off (it should be if the lid is closed).


Is (Ubuntu) Linux file copying algorithm better than Windows 7?


Windows Copying is a real mess ever since Windows Vista. Even Microsoft claims they've improved the performance, from a user perspective, it's not quite visible. Even with single file the copying window appears too much time for 'Calculating' and then finishing the copy(Even after 100% completion some times the dialog remains active).


At the same time, I was backing up some files in Ubuntu Linux. I felt it's really fast. Might be a feeling caused by faster UI updates.


I read an informative post from Jeff Atwood few years back on Windows File Copying. but what my specific questions are



  • Is (Ubuntu) Linux file performance is better than Windows-7?

  • Are both algorithms, Windows and Linux is making use of multiple threads and pipelining mechanism to improve the speed? If yes, which one is better?



Answer



The standard copy builtin in Windows isn't very good, but Windows comes with two advanced commands that are far more efficient: xcopy and robocopy. Especially when you need full control over advanced filesystem features like ACLs or alternate data streams, robocopy is the tool of choice.


As an example, if you are copying a large directory structure, you may wish for the target to be unfragmented. The standard invocation of robocopy is already quite good at that, but since directory entries are updated as subdirectories get created, you can still get fragmented directories. To prevent that, you can run robocopy in two passes, the first of which only creates the target directory structure without copying any file content, and the second to actually copy the file bodies.


Altogether, robocopy is very efficient and fully aware of NTFS features.


boot - How to move windows system partition

I'm running a Windows 2003 server on Linux/KVM (But should not matter where it runs actually). The HD image has just one partition starting with 63 sectors offset and all works fine.


Now I want to use 2048 sectors offset and I'm able to create an image where the partition is moved to the right place (1985 sectors back, partition table corrected), using dd and sfdisk.


But when I try to boot this it just hangs with 100% CPU usage. The last message is Booting from Hard Disk ... (That means BIOS and MBR code is able to boot "something").


So even the MBR boot code and partition table seems correct it looks like something has to be changed within the windows system partition itself. What is it?


Here is the original partition layout:


$ fdisk  -l /dev/vg0/vm07_root
Disk /dev/vg0/vm07_root: 25 GiB, 26843545600 bytes, 52428800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb11db11d

Device Boot Start End Sectors Size Id Type
/dev/vg0/vm07_root1 * 63 52426814 52426752 25G 7 HPFS/NTFS/exFAT

Here is the new layout (mounting the moved partiton works):


$ fdisk  -l /dev/vg0/vmXX_root
Disk /dev/vg0/vmXX_root: 25 GiB, 26843545600 bytes, 52428800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb11db11d

Device Boot Start End Sectors Size Id Type
/dev/vg0/vmXX_root1 * 2048 52428799 52426752 25G 7 HPFS/NTFS/exFAT

And here the MBR plus (corrected) partition table hexdump of the new one (I'd also tried other MBR code from syslinux):


$ dd if=/dev/vg0/vmXX_root skip=0 count=1 | hexdump -C
1+0 records in
1+0 records out
512 bytes copied, 1.9217e-05 s, 26.6 MB/s
00000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |3.....|.P.P....||
00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........|
00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........|
00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 07 8b |...It.8,t.......|
00000040 f0 ac 3c 00 74 fc bb 07 00 b4 0e cd 10 eb f2 88 |..<.t...........|
00000050 4e 10 e8 46 00 73 2a fe 46 10 80 7e 04 0b 74 0b |N..F.s*.F..~..t.|
00000060 80 7e 04 0c 74 05 a0 b6 07 75 d2 80 46 02 06 83 |.~..t....u..F...|
00000070 46 08 06 83 56 0a 00 e8 21 00 73 05 a0 b6 07 eb |F...V...!.s.....|
00000080 bc 81 3e fe 7d 55 aa 74 0b 80 7e 10 00 74 c8 a0 |..>.}U.t..~..t..|
00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V|
000000a0 00 b4 08 cd 13 72 23 8a c1 24 3f 98 8a de 8a fc |.....r#..$?.....|
000000b0 43 f7 e3 8b d1 86 d6 b1 06 d2 ee 42 f7 e2 39 56 |C..........B..9V|
000000c0 0a 77 23 72 05 39 46 08 73 1c b8 01 02 bb 00 7c |.w#r.9F.s......||
000000d0 8b 4e 02 8b 56 00 cd 13 73 51 4f 74 4e 32 e4 8a |.N..V...sQOtN2..|
000000e0 56 00 cd 13 eb e4 8a 56 00 60 bb aa 55 b4 41 cd |V......V.`..U.A.|
000000f0 13 72 36 81 fb 55 aa 75 30 f6 c1 01 74 2b 61 60 |.r6..U.u0...t+a`|
00000100 6a 00 6a 00 ff 76 0a ff 76 08 6a 00 68 00 7c 6a |j.j..v..v.j.h.|j|
00000110 01 6a 10 b4 42 8b f4 cd 13 61 61 73 0e 4f 74 0b |.j..B....aas.Ot.|
00000120 32 e4 8a 56 00 cd 13 eb d6 61 f9 c3 55 6e 67 81 |2..V.....a..Ung.|
00000130 6c 74 69 67 65 20 50 61 72 74 69 74 69 6f 6e 73 |ltige Partitions|
00000140 74 61 62 65 6c 6c 65 00 46 65 68 6c 65 72 20 62 |tabelle.Fehler b|
00000150 65 69 6d 20 4c 61 64 65 6e 20 64 65 73 20 42 65 |eim Laden des Be|
00000160 74 72 69 65 62 73 73 79 73 74 65 6d 73 00 42 65 |triebssystems.Be|
00000170 74 72 69 65 62 73 73 79 73 74 65 6d 20 6e 69 63 |triebssystem nic|
00000180 68 74 20 76 6f 72 68 61 6e 64 65 6e 00 00 00 00 |ht vorhanden....|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 2c 48 6e 1d b1 1d b1 00 00 80 20 |.....,Hn....... |
000001c0 21 00 07 8a 0b bf 00 08 00 00 00 f8 1f 03 00 00 |!...............|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|

macos - How to Access `/dev` From Inside a `chroot` Jail?

     How can one access /dev from within a chroot jail? I'd like to know how to do this on OS X v10.11.5 'El Capitan,' in particular. I've already tried to create an automounting NFS share in order to emulate a bind mount to do this (as described here) without success. Are there any other options?

windows 7 - What would happen in a Software Raid 1 of one HDD and one SSD?

I'm running my Windows 7 installation and all of my apps from an SSD for performance reasons. Since SSD's can instantly die at any moment, I'm looking for some kind of data backup strategy. Right Now I regularly backing up the drive image on a hard disk, but that only happens once per day, which is not enough for my taste.


So I got an idea: What if I created a software raid 1 of the SSD and partition on my Hard disk?


All data would be mirrored on both drives, making this a lot safer. But what about performance? Will Windows 7 detect that the SSD is faster than the hard drive and always read from the SSD? Or will it randomly read from both, thus reducing read performance?


Thanks,


Adrian


Edit: I just found this article which basically answers my question. Feel free to close this post.

Is it possible to use two internet connections and combine their upload for bittorrent?


Since each Internet connection has its own IP, I see that as a problem. Or can you use one connection as the primary connection, and then use the other connection to spoof packets coming from the primary one?



Answer



The simplest way to use the upload of the 2 lines is to send the packets on the 2 lines just like if you route half the packets to WAN1 and the other half to WAN2.


But in practice it usually doesn't work that well, since you have some things to consider :



  • Your ISP may think you try to spoof the IP source address when routing over from the other interface and drop them.

  • The so-called "spoofed" packets will have their answer on the real interface, so only one line will be used for downstream

  • The latency between the packets might be much different (ie: more jitter), so the packets will be received out-of-order. That should not be a big deal for TCP-based data streams, but for more RT-oriented one that are quite sensible to jitter (such as TCP-interactive : with nagle's algorithm disabled or VoIP) it can introduce nasty delays due to buffering.


@Garth: I don't think he wants to use 2 IP addresses, just the 2 connections, so I don't see the prob with BT (It's only level 2 related) but the usual level 2 caveats do apply.


hashing - How can SHA512 make a long string into a short string


I´m wondering how this random and very long string


€£$€@]}$€{[$£}]£[€€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]hXC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpb€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]hkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubh€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]hj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]h€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%EFVyubhj<G/p9\<\]}}]@}$]$€}{$€Ã¸Ã¸Ã¥l5940hgsy/)T(&¤%}]€$ygrevae48g85XC&Yi45wtgsb}]

Can turn into this much shorter string


bb90e8b58596c55070ee88b25ff01627ab0c227cd11d6f876af9e81a0cd12e9d8a1ebce3af5b0fd8098ac3946a590c55ebe890066db6403cb0ee324c6edf9f3d

This dosent make any sense for me. Can two strings be the same in sha512. Etc we have string 1 and string 2 and sha512 hashed they are the same?



Answer



Very basically, a hash function (such as SHA512) takes a variable-length input (which may be shorter, longer or the same length as the output hash, and which may or may not have a maximum size dictated by how the hash function works), and through a variety of steps uses that input to alter the hash function's internal state in a predictable (deterministic) manner. At the other end, when there is no more input, the (or some portion of the) internal state of the hash function is read, possibly further processed somehow, and delivered as the output of the hash function. That output is called the "hash" of the input data.


A hash function is designed as a one-way function, also known as a trap door function; in other words, it is designed such that it is easy to compute the output given the input, but it should be infeasible to calculate the input given the output, even in cases where the input is smaller than or the same size as the output.


The output hash is of a fixed length basically because the size of the hash function's internal state (and the result of post-processing that state for output) is known. The exact output hash length is picked to be a good fit for the hash function's internals and to provide the desired level of security. Some hash functions, like MD5, RIPEMD160 or SHA-1, have a fixed-size output; others, like SHA-2 or SHA-3, can give different-length outputs depending on the specific needs of the system using the hash function.


It is possible (and even likely) that two different inputs to a hash function will produce the same output hash. For a hash with n bits of output and for two random inputs, this will happen on average after trying 2n/2 combinations, and it is guaranteed to happen by the time you have tried 2n+1 different inputs: in the worst (or best) case, each of the 2n inputs will give a unique output out of the set of 2n possible outputs, so if you try one more input then it must match one of the already computed outputs. That's called a hash collision. The aim of a cryptographic hash function such as the SHA family of hashes is not to make such collisions impossible (without expanding the hash to the full size of the input, which sort of negates the point of the hash, that is mathematically impossible), but rather to make finding such inputs extremely hard.


A hash function that allows finding collisions significantly faster than 2n/2 to 2n operations (depending on the exact method of attack; primarily, look up so-called preimage and birthday attacks if you want to learn more about that) is generally considered broken for cryptographic applications. This is why SHA-1 started its track toward deprecation in web browsers for TLS certificates in 2014 or so after a theoretically feasible attack became known in 2012, and why the old workhorse MD5 is considered horribly broken for almost any cryptographic application.


It's also important to keep in mind that the output of a hash function such as SHA512 is not the hexadecimal string that you show in your question. That is one representation of the actual hash, which is just a 64-byte (512-bit) binary value. It could just as well be stored in binary form, in Base64 encoded form, or some other representation.


vpn - barebones features for a DD-WRT router acting as PPTP server

I have a little router (Linksys E900) only to act as a VPN server. I have a decent router behind it, handling radio anyway. So I am happy to relegate any other CPU-intensive stuff to the bigger router, if it is expected make a difference in VPN performance in the slower one. (I am currently getting much slower throughput, esp. from router to client, than the endpoints' connections could explain.)


What (or where) is a list of features on by default that would be worth turning off?


Keep DHCP, remote management and PPTP server only? What else drains resources?


Thanks!


PS: A relevant DD-WRT forum thread is under http://www.dd-wrt.com/phpBB2/viewtopic.php?p=737253#737253 My SuperUser question about the asymmetric VPN speed itself is under how to troubleshoot asymmetric speed PPTP VPN speed? (downlink to client is slow, the server bandwidth up, and there is no encryption overhead)

networking - Connecting two networks, two ISPs, two routers and two different subnets


Can anyone suggest me how can I set up two routers with their own ISPs and connect the two networks, so that the devices behind the two routers can ping each other?


NOTE:



  1. The two DHCP servers have to be kept running, and I can’t disable it at all.

  2. I don't have the money to buy any new equipment now.

  3. The two ISPs need to be available on their respective networks 24x7.

  4. I have a spare router available. It is not being used in my network.



Answer



If both network's LANs are using different network numbers, this should work. If both networks happen to be numbered the same, one will have to be re-numbered on the LAN side.




Pronoun key


"Your Router" --- Network A's router that connects to A's ISP, with a LAN gateway of 192.168.1.1 and a netmask of 255.255.255.0. (whatever it really is)


"The Other Router" --- Network B's router that connects to B's ISP, with a LAN gateway of 192.168.5.1 and a netmask of 255.255.255.0. (whatever it really is)


"The Spare Router" --- That extra router.




On the spare router, disable DHCP client on WAN and and DHCP server on LAN; both interfaces will have to be configured manually. Also disable NAT on the spare router.


Find an unused IP address on your router's LAN network that is not in the DHCP pool. Often, there are a few extra addresses at the bottom of the network that aren't handed out by the DHCP server: If your LAN gateway is 192.168.1.1, usually 192.168.1.2 is not automatically handed out. In any case, find an unused IP address on your router's LAN, and manually configure the spare router's LAN to that IP; I shall assume it is the .2 number. Also set the spare router's LAN netmask and other network attributes to match your LAN's parameters.


Do much the same on the other router's LAN: Find an unused IP address outside of the DHCP pool. If there are no addresses outside of the pool, you'll have to reserve one so it's not assigned to another host accidentally. I shall assume that IP address is also the .2. On the spare router, manually configure the spare router's WAN port to 192.168.5.2, and its netmask to that of the other router's LAN.


Setting the spare router's DNS and gateway is not absolutely required, but setting it to the other router's gateway would be OK.


The spare router should then have a WAN interface numbered 192.168.5.2 and be connected to the other router's LAN. It should also have a LAN interface of 192.168.1.2 and be connected to your router's LAN. The spare router should be able to ping hosts on your LAN, as well as on the other LAN at this point without any further configuration.


On your router, create a static route: 192.168.5.0/255.255.255.0 gateway 192.168.1.2


On the other router, create a static route: 192.168.1.0/255.255.255.0 gateway 192.168.5.2


Hosts on your network should now be able to reach hosts on the other network. Remember that NAT must be disabled on the spare router.


How to do a Windows 10 repair installation?

In order to resolve issues related to booting and the start menu, I am trying to run a repair installation of Windows 10.


The computer was delivered with a pre-installed Windows 7 without any installation disks (delivering those seems to have fallen out of fashion, unfortunately) and was unintentionally upgraded to Windows 10 when the user ran into Microsoft's X means accept trap.


As is suggested in this forum, a repair install of Windows 10 can be done despite not having any installation media by using the Windows 10 ISO. I have thus prepared a bootable USB storage with the ISO file generated by Microsoft's MediaCreationTool.exe.


Upon booting the destination computer from that device, however, I am confronted with the following message (in German, my translation below):


German message box text:


In English:



Apparently, you have launched an upgrade and conducted a system reboot from the installation media. If you wish to continue the upgrade, remove these media from the PC and click "Yes". In order to run a clean reinstall instead, click "No".



I am confused by this message and do not understand what it is trying to tell me:



  • The premise seems incorrect. I have not yet started anything, least of all an "upgrade".

  • As I have not started anything, and as I do not want to run any "upgrade" (I have not purchased any newer or higher version that the installed OS could be upgraded to), I do not want to continue the upgrade. Hence, "Yes" seems like the wrong choice.

  • I want to repair the existing installation. I do not want to entirely reset the system. Thus, "No" appears to be the wrong choice, as well.


How do I proceed from this point to reach any repair installation options?

macos - Macbook Pro - Sound doesn't work and there's a red light coming out of my headphone jack


How do I get my sound working again? It works with Headphones, but when I unplug the headphones a red light is coming out of the headphone jack and I can't adjust the volume on my Macbook Pro.



Answer



macRumors ref: No sound out of MacBook speakers & red LED in Headphone jack.
The red light is probably because its a Mini-TOSLINK port.



There is a metal prong in the jack and sometimes it can be bent,
causing the digital audio to be turned on when it shouldn't be.



.



The problem is there is a switch in the jack that tells it if you have a mini headphone plug or an optical plug plugged into the headphone port. The problem is when you remove the plug, the jack doesn't know it and keeps shining the red light to talk with the optical. This disables the internal speakers and you see digital out instead of internal speakers in the speaker conrtol panel. Plugging and unplugging the speakers may get it working right for awhile but it won't last forever.



And, for the brave hearted,



I slid a paperclip in, and pushed out a little metal on the side.
That did the job, and I have internal sound again. And the digital red light, is now off.





Important Update:
If this answer helped you, please do not add a 'thank you' as another answer...
This is not a forum -- please read the faq.


windows 7 - How to purposefully exclusively lock a file?


I want to hold an exclusive lock on a file so it cannot be read or written by anything else. Is there a simple Windows tool or command to do this?


I suppose the tool or utility would implement the LockFileEx Windows Function.


Note: I've tried text editors like Notepad and Notepad++ on a text file but they don't hold an exclusive lock on it.



Answer



Try Easy File Locker (freeware).


enter image description here


windows 7 - How to clear jump lists for a specific program


How do you clear the jump list of recently opened files for a specific program?


I'm looking to clear entries for programs on the Start Menu and pinned to the taskbar.


Jump list



Answer



Jump lists are stored in the user profile. To view them, open the following path:


%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations


Each file in there is a jump list for a single application. To find out the one you need, add or remove an item on the jump list you want to clear. Then sort the files in this folder by modified time to find out which one you just edited. Delete the file to remove the jump list.


In Windows 10, it is not possible to navigate to this path using Windows Explorer, however copying and pasting it to the address bar does work.


Wake on Lan doesn't work in Windows 8


I have a dual boot system with Windows 7 and Windows 8.


After I shutdown in Windows 7, wake-on-lan works perfect but if I shutdown in Windows 8, it doesn't work. Even if I sleep or hibernate in Windows 8, wake-on-lan works.


Can anyone tell me why is this happening?



Answer



I found that it was related to the Fast Startup feature in Windows 8. After I disabled it, it worked fine.


Here is how:




  1. Press the Win + W.




  2. Type change power buttons and press Enter.


    S2




  3. Click Change settings that are currently unavailable.


    S3




  4. Uncheck Turn on fast startup.


    S4




  5. That's it.




Why should I use Vagrant instead of just VirtualBox?


I've been using VirtualBox for many years to create a development environment.


A lot of my colleagues are talking about Vagrant and many people seem very excited about it but I just can't seem to grasp the benefits of it.. seems to me like it's a series of new commands to learn in order to do the same things I did with Virtualbox.


With VirtualBox, I install and configure an environment perfectly, then I can package it up as an OVA or whatever and share it with other office users. You can take a snapshot in VirtualBox if something goes wrong.


Puppet and chef aren’t really part of Vagrant, they’re their own thing right?


So yes, what benefits specifically does Vagrant offer over VirtualBox on it's own?



Answer



This is a big question, so I'm going to break it up into three sections.



Vagrant is used to set up one or more virtual machines by:



  • Importing pre-made images (called "boxes")

  • Setting VM-specific settings (IP address, hostnames, port forwarding, memory, etc.)

  • Running provisioning software like Puppet or Chef


Note that it doesn't install software or set up the machine past loading the VM and setting VirtualBox settings. Think of it as a scripting engine for VirtualBox.


Here are some reasons I've seen for using Vagrant over just VirtualBox.


1. Set Up Multi-VM Networks with Ease


Most of the Vagrant power-user content I've read has been about setting up multiple VMs at the same time. Vagrant gives you a single config file to set these up, enabling you to launch all of them with one command.


Say you've configured three VMs to network with each other using static IPs on the 192.168.1.* subnet. You find yourself in a location that is already using that subnet to hand out IP addresses, and your VMs now conflict. With Vagrant, you can simply edit the Vagrantfile and reload the VMs, whereas with VirtualBox you'd have to open the settings for each VM, if not boot each VM and change them inside.


2. Source Control


By putting the settings in a text file, it enables the configuration to be put under source control. Made some changes last week and accidentally broke the image? Just revert the changes and reload the VM. You can accomplish this with VirtualBox snapshots, but it will take up much more space than just a Vagrantfile.


3. Various Platforms


There's a large number of boxes available at sites such as http://vagrantbox.es. This enables you to try various OSes or distributions, applying the same provisioning to set up similar environments. This can help with testing or adding support to new platforms, and would be time-consuming using just VirtualBox.


There are a lot of arguments for using provisioning software, as well as using image snapshots. For additional discussion, I'll point you to Stephen Nelson-Smith's excellent article How to Build 100 Web Servers in a Day.


mp3 - How can I transfer music from my iPhone to my computer?


I'd like to transfer the (non-DRM) music I have on my iPhone to my computer.


Which application can I use to do that? I found several shareware applications but they didn't really work.



Answer



MediaMonkey


Recent versions of MediaMonkey allow you to copy music from your iPhone to your computer. I've just tested it myself and sure enough it can transfer music from the phone to my PC.



http://www.mediamonkey.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=3&nav=0,1



You need to scroll down the left hand tree in MediaMonkey and expand your iPhone to see the music.


alt text


Friday, 27 April 2018

Is it possible to mount an ISO image in Windows 8 without third-party software?


I often have to access ISO images to install software on my machine. Typically I install a third-party tool to mount the ISO file and expose it as a virtual drive within Windows.


Examples of third-party tools I have used are:



I am now using Windows 8 and would like to know if it is possible to mount an ISO image within Windows without installing a third-party tool.



Answer



Windows 8 includes the functionality to mount an ISO image and expose it as a virtual drive within Windows without using 3rd party software.



  • Locate an ISO file

  • Right click and select Mount from the context menu or double click on the ISO file


ISO context menu Windows 8


It will be automatically mounted by Windows 8 and exposed as a virtual drive.


Power Supply Too Big?


I replaced my working 350W power supply with a new 500W power supply. My computer would not boot with the new power supply. It would turn on for a few seconds and then turn off. I then tested the new 500W PS in a different computer and it runs just fine. I used a Kill-a-Watt meter and found that my computer is only using 87W of power.


Is it possible that the under-voltage or under-current protection in the PSU is causing it to shut off because my computer is not drawing enough power? I've also heard that it is very inefficient if you are drawing less than 20% of your PSU max power. In my case 87W out of 500W is only drawing 17% of max power.


Additional information:


This is a home-built computer with Gigabyte P55 based motherboard. The board uses the 24+4 pin ATX connector and a 8 pin connector for the CPU. It works just fine with the 350W which only has a 24 pin ATX connector and 4 pin CPU connector. With the newer 500W PSU I tried various combinations of 24/24+4 for the ATX connector and 4/8 pin connector for the CPU.


Other differences between the PSUs are that the old one had a 115V/230V selection switch and the new PSU auto adjusts. Also the new PSU is modular and I tried with and without any of the SATA power connectors connected.


I even tried clearing the CMOS, took out the battery and waited 15 minutes.


http://en.wikipedia.org/wiki/Power_supply_unit



Although a too-large power supply will have an extra margin of safety as far as not over-loading, a larger unit is often less efficient at lower loads (under 20% of its total capability) and therefore will waste more electricity than a more appropriately sized unit. Additionally, computer power supplies generally do not function properly if they are too lightly loaded. Under no-load conditions they may shut down or malfunction.




Answer



It's theoretically possible. Switching power supplies (like a PC PSU) all have a minimum load requirement, typically on the +5V rail. Perhaps there was a device you forgot to plug in on the +5V/+12V rail?


Is my SSD drive going bad? SMART error


Is there something wrong with my SSD drive ? It's still under warranty so I can replace it ;)


SMART Error Log Version: 1
ATA Error Count: 1
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 1 occurred at disk power-on lifetime: 1537 hours (64 days + 1 hours)
When the command that caused the error occurred, the device was active or idle
.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 00 00 00 00 00

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
ec 00 00 00 00 00 00 00 00:19:35.000 IDENTIFY DEVICE
e5 00 00 00 00 00 00 ff 00:19:34.500 CHECK POWER MODE
b0 da 00 00 4f c2 00 00 00:17:57.100 SMART RETURN STATUS
ef 02 00 00 00 00 a0 00 00:17:57.100 SET FEATURES [Enable write cache]
ef aa 00 00 00 00 a0 00 00:17:57.100 SET FEATURES [Enable read look-ahea
d]

More generally: Are there specific techniques for SMART on SSD drives?



Answer



I don't know, if ssds support this, but for a normal hdd, if you suspect a problem, you let it do a short or long selftest:


smartctl -t short /dev/sdX
# or
smartctl -t long /dev/sdX

It will normally tell you how long this takes. Leave you computer on for that time. Then check the result with smartctl -a /dev/sdX. I recommend keeping a trail of smartctl -a outputs somewhere to compare what changed.


All that said, I really don't know, what SSDs these days support when it comes to smart. The last time I had an SSD connected to my main box, its smart was… well, it could use some improvement.


wireless networking - Brand-new PC only loads some domains when on Wifi


I have a new Lenovo Carbon X1 4th gen. Wired internet with an adapter works fine, but the wifi won't work. I tried installing the newest drivers, reinstalling windows, and even installing drivers for similar models. Everything has the same issue: Windows will report it's connected to wifi and has internet.


Chrome will attempt to load pages. But pages won't load - at all. They'll just keep trying to download forever and get very little data (some things will download, usually just the header).


Bizarrely, some websites are except from this. Google searches, for example, work perfectly; anything that ends in google.com works fine. I've tried leaving DNS/IP settings on automatic and using Google DNS but nothing changes.



Answer



"Google sites work, but other sites don't" is often due to what's known as a "Path MTU Discovery black hole". A PMTUD black hole is when something on your network — probably a local NAT gateway or firewall — either isn't sending ICMP "destination unreachable; fragmentation required but 'don't fragment' bit set" messages, or is blocking those messages from other network middleboxes.


To see if this is the case and work around it, try temporarily setting your MTU down to something low-ish like 1300 on your laptop's Wi-Fi interface. If all sites work when you're using a 1300-byte MTU, try adjusting it back upwards until you find the highest value that works.


Google sites are smart about this and always negotiate a TCP MSS (that's like the TCP-layer equivalent of an MTU) that results in an IP-layer MTU that's enough below 1500 to work on most networks, even if those networks have path MTU problems. That's why "Google sites work but other sites don't" is usually a give-away for this particular problem.


If manually setting a low MTU doesn't fix the problem, then your problem probably isn't a PMTUD black hole.


Access a Mac via hostname.local from a Windows PC


I'm the only Windows user at my workplace full of Macs. Of course, being the only person with a different setup, I'm often left to do my own IT troubleshooting.


The issue I have is that everyone's computer is accessible via {hostname}.local (eg, foobar.local), but when I type that in, the host can't be resolved.


I've found that if I change the .local part to my "Connection-specific DNS Suffix" then it works:


ping foobar.local            // Ping request could not find host foobar.local

ping foobar.corp.mywork.com // <-- now works. Resolves to 10.0.10.25

Simply switching to use the full part isn't an option (long story, but just trust me on that one).


So, how do I get Windows to resolve hostname.local addresses?



Answer



Install Bonjour for Windows, available from Apple. It's now confusingly named "Bonjour Print Services for Windows". It includes a Multicast DNS resolver, which will handle those ".local" addresses.


html - Copy data from "SELECT Multiple" Selection Box


I need to copy data from a selection box with the "multiple" HTML attribute that looks something like this:


EXTRACT FROM OP's image


I have tried selecting all options and do "Ctrl-C" but it didn't work. When I go to the source, I can get the data but there is no way to filter out the HTML codes that goes with it.



Answer








Copy all the option tags (see above) from the HTML source (you'll find them between select tags) and paste into Notepad++, then search/replace as follows with the Regular expression option selected:


1


Find what: (.*?)
Replace with: \1


You can also use Microsoft Word to search/replace as follows with the Use wildcards option selected:


2


Find what: \(*)\
Replace with: \1


How can I do find and replace parenthesis surrounded text with regex on Microsoft Word


I have a document that has (TL by user) all over the place. I'd like to replace this with nothing (thereby deleting it everywhere) but the user could be different or there could be many users (TL by user1) (TL by user3, superuser1). So far I have tried find (TL by .*) and replace with nothing but that gets rid of everything but the user and the surrounding paranthesis for some reason so I'm left with (user1) or (user3,superuser1). How can I get the regex to match and replace the entire match (TL by user) including the parans and everything inside?


This is on Word 2010, I will put more information when I get home later today



Answer



There is no actual "RegEx" searching in Office, but you can use the "Use Wildcards" option.


So since it's not real RegEx, the . doesn't do anything to help. You just need the * wildcard.


The next trick is that while performing a wildcard search in Word, the brackets () are used for grouping (like in RegEx), so if you want to search for literal brackets you need to escape them with a backslash (\).


Putting all that together and I end up with this Find command, which works as you want (based on my testing):


\(TL by *\)


Find and Replace dialog settings I used:


enter image description here


networking - Public wireless access point on a private network

hopefully someone has an idea on this.


I have a business with a private wired network, but want to provide a public wireless access point for the internet. Users on this AP should not be allowed to see anything on the private network.


I have tested this using 2 routers I have in my house, managed to get 2 networks up like so


Modem -> Router 1 -> Private Computers

^-> Router 2 -> Public computers

However, router 2 should be acting as the public AP, but anything on it can still ping anything connected to the 1st router.


I don't have the ability to change the Modem to the public side, so the solution needs to just be able to plug into the private network and just provide a public LAN that is separated from the main (private) LAN.


Basically just looking for a product/router that will allow this. I have my eye on a Netgear fvs318 which I think will do the trick, but I'm unsure, so some advice/help/recommendations would be great.


Thanks!

How do I convert a video to GIF using ffmpeg, with reasonable quality?


I'm converting a video to GIF file with ffmpeg:


ffmpeg -i input.flv -ss 00:00:00.000 -pix_fmt rgb24 -r 10 -s 320x240 -t 00:00:10.000 output.gif

It works great, but output gif file has a very low quality.


Any ideas how can I improve quality of converted gif?



Answer




GIF output from ffmpeg
183k


ffmpeg can output high quality GIF. Before you start it is always recommended to use a recent version: download or compile.


ffmpeg -ss 30 -t 3 -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif


  • This example will skip the first 30 seconds (-ss 30) of the input and create a 3 second output (-t 3).

  • fps filter sets the frame rate. A rate of 10 frames per second is used in the example.

  • scale filter will resize the output to 320 pixels wide and automatically determine the height while preserving the aspect ratio. The lanczos scaling algorithm is used in this example.

  • palettegen and paletteuse filters will generate and use a custom palette generated from your input. These filters have many options, so refer to the links for a list of all available options and values. Also see the Advanced options section below.

  • split filter will allow everything to be done in one command and avoids having to create a temporary PNG file of the palette.

  • Control looping with -loop output option but the values are confusing. A value of 0 is infinite looping, -1 is no looping, and 1 will loop once meaning it will play twice. So a value of 10 will cause the GIF to play 11 times.


Advanced options


The palettegen and paletteuse filters have many additional options. The most important are:




  • stats_mode (palettegen). You can force the filters to focus the palette on the general picture (full which is the default), only the moving parts (diff), or each individual frame (single). For example, to generate a palette for each individual frame use palettegen=stats_mode=single & paletteuse=new=1.




  • dither (paletteuse). Choose the dithering algorithm. There are three main types: deterministic (bayer), error diffusion (all the others including the default sierra2_4a), and none. Your GIF may look better using a particular dithering algorithm, or no dithering at all. If you want to try bayer be sure to test the bayer_scale option too.




See High quality GIF with FFmpeg for explanations, example images, and more detailed info for advanced usage.


Also see the palettegen and paletteuse documentation for all available options and values.





GIF output from ffmpeg
227k


Another command-line method is to pipe from ffmpeg to convert (or magick) from ImageMagick.


 ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos" -c:v pam -f image2pipe - | convert -delay 10 - -loop 0 -layers optimize output.gif

ffmpeg options:




  • -vf "fps=10,scale=320:-1:flags=lanczos" a filtergraph using the fps and scale filters. fps sets frame rate to 10, and scale sets the size to 320 pixels wide and height is automatically determined and uses a value that preserves the aspect ratio. The lanczos scaling algorithm is used in this example.




  • -c:v pam Chooses the pam image encoder. The example outputs the PAM (Portable AnyMap) image format which is a simple, lossless RGB format that supports transparency (alpha) and is supported by convert. It is faster to encode than PNG.




  • -f image2pipe chooses the image2pipe muxer because when outputting to a pipe ffmpeg needs to be told which muxer to use.




convert options:




  • -delay See Setting frame rate section below.




  • -loop 0 makes infinite loop.




  • -layers optimize Will enable the general purpose GIF optimizer. See ImageMagick Animation Optimization for more details. It is not guaranteed that it will produce a smaller output, so it is worth trying without -layers optimize and comparing results.




Setting frame rate


Set frame rate with a combination of the fps filter in ffmpeg and -delay in convert. This can get complicated because convert just gets a raw stream of images so no fps is preserved. Secondly, the -delay value in convert is in ticks (there are 100 ticks per second), not in frames per second. For example, with fps=12.5 = 100/12.5 = 8 = -delay 8.


convert rounds the -delay value to a whole number, so 8.4 results in 8 and 8.5 results in 9. This effectively means that only some frame rates are supported when setting a uniform delay over all frames (a specific delay can be set per frame but that is beyond this answer).


-delay appears to be ignored if used as an output option, so it has to be used before - as shown in the example.


Lastly, browsers and image viewers may implement a minimum delay, so your -delay may get ignored anyway.


Video courtesy of U.S. Fish & Wildlife Service National Conservation Training Center.


cpu - Lowering the throttling temperature in Windows 8 for a laptop

I've seen a lot of posts about disabling the throttling temperatures but none regarding setting them.


I have an Acer V17 Nitro, i7 laptop and it's CPU temperature reaches 95°C before throttling. It's a very powerful laptop, crippled by a bad cooling system. I already undervolted by 70mV and disabled hyper boost.


Currently, I have to go into Power Options and adjust Maximum CPU Frequency between 40% and 80% to keep the temperatures under 80°C. But this depends on the application. And I have to do this manually for each application I'm using.


Ironically, some applications (especially Fortnite) will run just fine with the CPU frequency set to 30-40% with the temperatures only rising to 80°C, while others will run at the same temperatures with the maximum frequency set to 80%. It just depends on how the code was written and how many cores are being used.


I know the throttling temperature is set to 95°C for the CPU, but even if it doesn't melt the CPU, it can cause a lot of other issues, like melting the case.


I would prefer to lower the throttling temperature to something like 80°C. This way I don't have to adjust the maximum CPU frequency by hand every time.


Is there a way to do this from the BIOS? From Windows? Via a third party app?

bash - Unix command to list all directories larger than 10mb


Is this possible, and what would the command be?



Answer



du is the easiest way. Grab the directories of interest with perl.


du -m . | perl -ne '@l = split();print "@l\n" if $l[0]>=10'

Advanced Format HDDs, USB enclosures and Windows / Linux compatibility



I just bought a 1 TB Seagate Barracuda ST1000LM048 HDD. It's an Advanced Format drive, with 4096-byte sectors.


I planned using it with my cheap-but-trusted (and I do mean cheap, it's really generic chinese and I paid about 5 USD for it) 2.5" HDD enclosure, that's been with me for 5 years and multiple HDDs with no issues (I'm not sure if I ever used an Advanced Format HDD with it). It's basically a JMicron JM20329 Hi-Speed USB to SATA Bridge chip with some transistors and a USB port. Looks exactly like this:


enter image description here


When I bought the 1 TB HDD, I wasn't aware of the issues involving Advanced Format drives and HDD enclosures. I strongly suspect it might be playing a part here, but under certain circunstances I can access the data.


Now I'm not sure sure, because I just found an older Western Digital 500 GB Advanced Format HDD and it shows up on Windows Explorer using this same enclosure... What's going on here?!



When I connect it via USB enclosure to a Windows 8.1 laptop, no new volumes show up on Windows Explorer. When running Fedora 25 on the same laptop, connected via the same HDD enclosure, I can see the folders and files.


It works on a different Fedora 25 PC when I connect it via internal SATA. I have no Windows PC nearby where I can test it on internal SATA.


Possibly related: There seems to be something wrong / strange with the partition scheme, see bold text in the sections below. I'm really puzzled by it, as I have never seen a similar case before.



Windows 8.1 via USB Enclosure on my laptop


Since others have asked: I attach the drive after Windows has booted. Will see if it has any difference attaching it prior to boot.



  • The USB enclosure gets automatically detected and installed as "USB to ATA/ATAPI bridge".

  • The drive doesn't show up in Windows Explorer.

  • Disk Management (diskmgmt.msc) shows the disk as "Online, unallocated 931.5 GB, MBR-style partition table":


enter image description here


Fedora 25 via USB Enclosure on my laptop


I can see the files and folders and copy data to and from the drive.


disks information



  • Model: ST1000LM048-2E7172 (SDM1)

  • Size: 1.0 TB (1,000,204,886,016 bytes)

  • There's no Partitioning entry

  • Serial Number: [redacted]

  • Assessment: Disk is OK, one bad sector.

  • Volumes:

    • Size: 1.0 TB — 850 GB free (15.0% full)

    • Device: /dev/sdc (notice there's no partition number!)

    • There's no Partition Type entry

    • Contents: NTFS — Mounted at /run/media/[redacted]




disks SMART report



  • Updated: 47 years, 1 month and 23 days ago (!!!)

  • Temperature: ---

  • Powered on: ---

  • Self-test result: Unknown ()

  • Self assessment: Threshold not exceeded

  • Overall assessment: Disk is OK, one bad sector

  • SMART Attributes: the table is entirely blank (!!!)


fdisk -l output


Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x[redacted]

Fedora 25 via internal SATA on a desktop PC


I can see the files and folders and copy data to and from the drive.


disks information



  • Model: ST1000LM048-2E7172 (SDM1)

  • Size: 1.0 TB (1,000,204,886,016 bytes)

  • There's no Partitioning entry

  • Serial Number: [redacted], same as above

  • Assessment: Disk is OK (33 C / 91 F).

  • Volumes:

    • Size: 1.0 TB — 850 GB free (15.0% full)

    • Device: /dev/sda (notice there's no partition number!)

    • There's no Partition Type entry

    • Contents: NTFS — Mounted at /run/media/[redacted]




disks SMART report



  • Updated: Less than a minute ago

  • Temperature: 36 C / 97 F

  • Powered on: 8 hours and 0 minutes

  • Self-test result: Last self-test completed successfully

  • Self assessment: Threshold not exceeded

  • Overall assessment: Disk is OK

  • SMART Attributes: see image below


fdisk -l output


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x[redacted]

Answer



I believe the issue that you are having is that there is simply NO partitioning scheme on the disk.


What you may not realise is that Linux will allow you to treat the whole disk as a block device - ie a single big partition - and all the information you've provided seems to point to this kind of setup. I believe Windows will not support a raw block device.


The typical way to fix this problem would be to copy the data elsewhere, partition and then format the disk (using FAT or NTFS or some kind of file system both Windows and Linux can read) and then copying the data back on. If it is possible to do this whole process without actually moving the data off the disk, its high risk, and you really should back up the data first anyway, putting you back to square one.


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