Saturday 30 September 2017

windows xp - Program for getting the cursor's x,y coordinates?



Is there a program which lets you easily get the x,y coordinates for your cursor?


Basically, I move my cursor to somewhere on my screen, it shows me the x,y coordinates and has an option to copy them to the clipboard or export them somehow.


I can already do this if I take a screenshot and open it in MS Paint, then as I move the mouse cursor over the screenshot it shows the coordinates in the status bar, however I have to manually write them down, hence its not convenient.



Answer



Pegtop's PMeter can do this.


It also has a ruler and a color picker:


(here be screenshots)




Programmatically, this is done using GetCursorPos() Win32 API, or Control.MousePosition in .NET.


In other words, it's do-it-yourself time. Copy this to MousePos.cs:


using System;
using System.Drawing;
using System.Windows.Forms;

class Coords {
[STAThread]
static void Main(string[] args) {
bool copy = (args.Length == 1 && String.Compare(args[0], "/c") == 0);
Point point = Control.MousePosition;
string pos = String.Format("{0}x{1}", point.X, point.Y);
if (copy) {
Clipboard.SetText(pos);
} else {
Console.WriteLine(pos);
}
}
}

If you have .NET Framework, compile with:


csc MousePos.cs /r:System.dll /r:System.Windows.Forms.dll /r:System.Drawing.dll

Copy to clipboard:


mousepos /c

The C# compiler, csc.exe, can be found in C:\Windows\Microsoft.NET\Framework\v3.5 (the version may vary; you can use whichever you have).


windows 7 - Pinned start menu/taskbar shortcuts gone


I just restarted my Windows 7 PC to find all my pinned shortcuts have disappeared from the start menu and taskbar. I've looked here
"%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned"
And it seems the shortcuts are still there. Is there maybe a service that isn't running, which is causing this problem? Thanks.



Answer



Ahh, sorted it. I just deleted the shortcuts in the folder above, and then added them again. Dunno what caused it though. Thanks.


memory - Where does Windows 7 waste my RAM?

Short version:


I have a system with 4GB of RAM, and another one with 8GB. Both running Windows 7, with paging file disabled. Now the strange part is that I can open the same number of programs before Windows 7 says there is no more memory for new programs. I would expect that with double the memory I could open more programs before running out of RAM.


Long version:


Something is not adding up to me. A few years ago I had a 32-bit system, running Windows 7, with 3 or 4 GB of RAM. I had turned off the pagingfile, because the system is faster that way.


Back than I could have open an instance of Visual Studio, MSSQL Management Studio, a couple of Firefox tabs, and a couple of Chrome tabs. These were the ones that fit in that 3 or 4 GB RAM.


Now I have a 64-bit system, running Windows 7, with 8 GB RAM, pagingfile turned off.


I can have open the same number of programs: an instance of Visual Studio, MSSQL Management Studio, a couple of Firefox tabs, and a couple of Chrome tabs.


Now my question is, how does this add up? I cannot really feel the difference between 4 GB or 8 GB of RAM. I've been thinking of buying more RAM, but the motherboard does not support more. But even than, I'm not sure It would make a difference, since it seems the RAM is wasted somewhere.


What can I do to identify where the RAM is allocated, and more importantly, what can I do to keep the RAM unallocated/so I can use it for my purposes, not for who knows what hidden Windows features.


EDIT:


I have turned off paging, because writing to the disk slows the overall performance, and I think that amount of RAM should be enough to live with.


I think there is a problem here, because if I open some other programs on my 8 GB system, than windows alerts me that there is not enough memory, and I should close some programs.

Apple UK / British English keyboard key mapping

I've recently started using a Mac at work, and after having been used to PCs running Linux for many years, it's taken a while for me to resolve a few niggles. But there's still one that remains: I'm using a MacBook Pro which has an English (British) keyboard, and the following separate keyboard:


Apple English (British) keyboard


My problem is that the output from section key (§±, top left, under esc) is switched with the grave accent / backtick key (`~, bottom left, by the shift key), on the external keyboard only. They produce the correct output on the built-in keyboard. I have searched far and wide for a solution, but found nothing. I have looked at Ukelele to remap the keys, but as the built-in keyboard is working as expected, this doesn't appear to be of any use.


Can anyone help me switch the output of these keys?

shell script - Batch converting PNG to JPG in linux


Does anyone know a good way to batch-convert a bunch of PNGs into JPGs in linux? (I'm using Ubuntu).


A png2jpg binary that I could just drop into a shell script would be ideal.



Answer



Your best bet would be to use Imagemagick


I am not an expert in the actual usage, but I know you can pretty much do anything image related with this!


An example is:


convert image.png image.jpg

and it will keep the original as well as creating the converted image. As for batch. I think you need to use the Mogrify tool (from the same command line when in imagemagick). Keep in mind that this overwrites the old images.


The command is:


mogrify -format jpg *.png  

windows 7 - Cannot see files in my external HDD

I have HDD with a lot of video files. Usually I connect my HDD with TV to watch videos. Today I've connected the drive to my PC and noticed some hidden files, but nothing related to video. The files are:



  • $RECYCLE.BIN

  • System Volume Information (32KB)

  • .mediaDB_3495978201.db (19KB)


In explorer I see that 159GB free of 596GB. How can I found hidden video files and recover it?


I have added screen with broken drive G.


enter image description here

ntfs - Mark Deleted Files as Undeleted


The capacity of my hard drive is 500 GiB. 150 GB of data got deleted accidently. I didn't write any byte to the drive after that incident, so my data is guaranteed to be there. I have tried apps like Recuva, all apps show that the data is there and allow me to save the data in a different location, but the problem is I don't want to do that.


I just want that the files are again marked as not deleted in the MFT. Is there any app available for this purpose? I searched a lot but didn't find anything, is it possible to unmark files as deleted in the MFT or am I missing something? I could write an app for this if I knew how to do it manually.



Answer



Undeleting files on an NTFS volume is not as simple as flipping one bit. It is true that the difference between a deleted and non-deleted file is just one bit in the MFT, but one needs also to recover the file's contents, which are stored as streams, as well as re-flag the deleted sectors as used in the $Bitmap pseudo-file which contains one bit per sector, each bit indicates whether its corresponding cluster is used (allocated) or free (available for allocation).


The complexity of the job is such that all recovery tools prefer not to write to the damaged volume. For example, marking a sector in $Bitmap as used may cause cross-chaining if that sector was already used by another file.


This article demonstrated the problem very well with hex dumps :
Windows ‘File Recovery’ series : Part 5 Manually Recover a Deleted File From an NTFS File System.


Another article even contains the source code of a program that could be modified to unflip the "deleted" bit : Undelete a file in NTFS.


There are quite a few NTFS disk editors that can edit the MFT to flip that bit. Some that I found via Google (but luckily never needed to use) are :
WinHex
NTFS Data Recovery Toolkit
DMDE
Freeware Active Disk Editor


A possible solution which might even work would be to undo the deleted bit in the MFT, then use the chkdsk utility to try to recover the contents. This utility can recover the sectors-chains of files whose sectors were wrongly marked as available for reallocation and will fix up $Bitmap.


However, there is always the chance that this procedure may destroy your disk.


This is why you and all the commentators above (including myself) have not found any product that does in-place recovery. The possibilities for screwing up your disk are simply too much for anybody who is not a Microsoft employee working on NTFS.


My best recommendation for you is to get a second hard disk and recover the files on it. I believe you have found out that one backup disk is not enough. I have already had several cases of friends asking me to recover their only backup, and I always counsel them (sometimes too late) to have two backup disks.


In addition, at least one of the two backup disks should be disconnected from the computer. I advise this after hearing of a case where a computer has fried itself and every connected USB device, leaving the owner with no data and no backup in one hit.


How to hide the notifications of the Teamviewer (silent use) in Computer and Android phones


Is it possible to hide a quick panel of the TeamViewer in the right corner and other notifications and pop-ups to enable a "silent" remote session?


While using team viewer Host application in android phone(remote phone) and connected to that device , the host application is showing a permanent notification in remote phone as long as connection ends. How to disable that notification? (Not able to disable in settings>apps. Turn off notification is not found for teamviewer host app)



Answer



Under the TeamViewer Options, Advanced, enable "Automatically minimize local TeamViewer Panel".


Other than that, there is no way that allows you to do so; it would otherwise be a security concern...



macos - Hide all applications and show a specific app with shortcut key

OSX 10.6. I got rid of dashboard shortcut, never used it. I use stickies a lot on my desktop. Can be a pain getting to it at times. Any idea how to map the F4 key to: hide all applications and only show stickies?

linux - /dev/fd0 equivalent on windows. (Writing directly to tar floppy)

I am currently using a system I cannot change that writes tar files to a floppy disk.


I need to read/write the same type of disk on a windows machine.


The command used to create the disk in Linux is: "tar -cf /dev/sdb myfile"


Unfortunately, windows does not recognize disks created like this. I get the "disk not formatted" error when I plug in the usb floppy drive. (Expected, as it is not an actual filesystem)


I am trying to use 7zip command line to access the file, by typing "7z.exe -l A:" The floppy light comes on, but no archive is found. Is there a way to allow some software like 7zip to see the actual raw floppy contents? Because it IS a tar file, but has no mountable filesystem.

windows - Is it valid for %Comspec% to have multiple entries?


I'm working through troubleshooting a problem on my laptop, and I've noticed something odd - my COMSPEC environment variable has two values.


Output from typing SET at a command prompt:


ComSpec=%SystemRoot%\system32\cmd.exe;C:\Windows\SysWOW64\cmd.exe

Is this valid?


I've found a bunch of references like this one that seem to indicate that it should have only one value, but nothing definitive.



Answer



Nothing definitive, but to me it doesn't make sense and I would consider it an error. The purpose of the variable was to identity the command interpreter. (Emphasis mine). In the event of a user having several command interpreters, I would expect it to identity the default one.


Suppose you did have two entries in your comspec, what would you want to happen?




  1. The first one is used and the second is ignored. If so, then what is the point of the second one?




  2. It runs both shells. If so, then the logical consequence of this is that each routine is run twice which will certainly cause problems.




  3. It runs neither, which is also cause problems.




What I would suspect would happen is sometimes 1) and sometimes 3).


Friday 29 September 2017

How do I submit a bug report for Microsoft Office?


I have found a number of bugs in Microsoft Office 2007, but I can't find anywhere to submit bug reports. I have seen Microsoft Connect but it doesn't let me provide feedback on Office.


How do I submit a bug report for Microsoft Office?



Answer



The method for regular users is to contact Microsoft Support by phone or email. If they can reproduce the issue they will create the bug report on your behalf.


drive letter - How to fix "This disk doesn't contain a Windows-XP compatible partition"?


Previous Title


How can I assign a drive letter with the Windows XP recovery console?


I've read older post on this question but didn't help me to fix it so I'm asking it here again. I tried to install XP by removing external HD but didn't worked the same error is occurring.


While trying to install Windows XP I faced a new problem:


When I deleted the partition and made a new one the system assigned the drive letter J: to C: and my bootable disk's drive letter became C:. I now get the following error:



This partition is not compatible to install Windows XP.



I'm able to open the Recovery Console, so is it possible to assign the drive letter through it? I'm in big trouble as I also can't install Windows 7.


EDIT


I had a backup of windows 7 through which I got my system back but the problem is still exist that the setup is showing error continuously with installation of Windows XP.


Disk Selection


Error


When I select the C: partition to install XP it gives the error and when trying on J: giving me the same error. While in Windows 7 C: is C: and J: is E:, K: is F:, E: is H:, F: is I:, G: is J:, H: is K:, and the bootable USB is D: at the time of boot while I've assign it X:.


So now how can I fix it to get rid of from this problem.



Answer



So finally I overcome on this problem after restore from Windows 7 backup I was still not able to install the Xp on my system so I booted from Windows 7 USB and deleted all partition on my system drive and then booted from Windows XP USB and created the partition and get back on Windows XP.


networking - Does tcpdump bypass iptables?


I mistakenly setup open resolver DNS server, which was soon used for bunch of DDoS attacks originating somewhere from / to Russia. For that reason I completely blocked port 53 on both DNS servers for everyone except for trusted IP's. It does work, I am not able to connect to them anymore, but what seems weird to me is that when I run tcpdump on eth1 (which is interface on server with public Internet) I see lots of incoming packets from attacker to port 53.


Is it normal that tcpdump display these packets even if iptables drop them? Or did I configure iptables wrong?


On other hand I don't see any outgoing packets from my server, which I did before, so I suppose that firewall is kind of working. It just surprise me that kernel doesn't drop packets entirely? Or is tcpdump hooked to kernel in a way that it sees the packets even before they get to iptables?



Answer



This is a nice question.


As a matter of fact, tcpdump is the first software found after the wire (and the NIC, if you will) on the way IN, and the last one on the way OUT.


Wire -> NIC -> tcpdump -> netfilter/iptables

iptables -> tcpdump -> NIC -> Wire

Thus it sees all packets reaching your interface, and all packets leaving your interface. Since packets to port 53 do not get a reply, as seen by tcpdump, you have successfully verified that your iptables rules have been correctly configured.


EDIT


Perhaps I should add a few details. tcpdump is based on libpcap, a library which creates a packet socket. When a regular packet is received in the network stack, the kernel first checks to see whether there is a packet socket interested in the newly arrived packet and, if there is one, it forwards the packet to that packet socket. If the option ETH_P_ALL is chosen, then all protocols go thru the packet socket.


libpcap implements one such packet socket with the option activated, keeps a copy for its own use, and duplicates the packet back onto the network stack, where it is processed by the kernel in the usual way, including passing it first to netfilter, the kernel-space counterpart of iptables. Same thing, in reverse order (i.e., first netfilter then last the passage thru the packet socket), on the way out.


Is this prone to hacking? But of course. There are certainly proof-of-concept rootkits using libpcap to intercept communications destined to the rootkit before the firewall can lay its hand on them. But even this pales in comparison with the fact that a simple Google query unearths working code hiding traffic even from libpcap. Still, most professionals think the advantages vastly outweigh the disadvantages, in debugging network packet filters.


How to disable autofocus on input fields in Chrome?


Is is possible in general to make Chrome not to focus on any of the fields automatically, for example, after the page has been loaded?


Extensions that use keys on keyboard don't work well with autofocus and type instead of executing commands.



Answer



I've just written script for you:


// ==UserScript==
// @name Disable auto-focussing
// @author ComFreek
// @description Disable auto-focussing
// @include *
// @version 1.0
// ==/UserScript==

var maxTime = 3000;
var timeoutInterval = 5;

var usedTime = 0;
var isManualFocus = false;
function check() {
if (!isManualFocus && document.activeElement.tagName.toLowerCase() == "input") {
console.log("BLURRED");
document.activeElement.blur();
}
usedTime += timeoutInterval;
if (usedTime < maxTime) {
window.setTimeout(check, timeoutInterval);
}
}
check();


document.body.addEventListener("click", function (evt) {
if (evt.target.tagName == "INPUT") {
console.log("MANUAL CLICK");
isManualFocus = true;
}
});

document.body.addEventListener("keydown", function (evt) {
isManualFocus = true;
});

Warning The script will interfere with the user if he immediately starts typing while the script is still operating. This is fixed.


Installation (manual method)




  1. Save the script as XX.user.js (XX can be any string, but .user.js is important here!)




  2. Open the extensions page in Chrome (the URI is chrome://extensions/ as of Chrome v31)




  3. Drag the script from the file explorer and drop it over the extensions page.




  4. Confirm the installation




Installation (TamperMonkey)


My script should work with TamperMonkey according to OP's comment below. Please consult TamperMonkey's manual for further information on how to install my script.


Aligned partitioning of 2TB disk with Linux fdisk


Is there a way to create a single 2TB partition, which is 4096-byte-sector aligned, on a disk using the standard Linux fdisk (I have tried version 2.17.2)?


I've tried the following things and ran into the described error:



  • If I simply use the -u flag, it sets the cluster size to one sector of 512 byte. Then, the partition would have to be 3,906,250,000 clusters long and fdisk truncates this number to 2,147,483,647 (2^31-1).

  • If I use -b 4096, it allows me to create the partition just fine (with length 488,281,506 sectors), but if I check the size of the resulting partition using blockdev --getsize64, it shows that the partition is only 250GB big, i.e. it is still using a sector size of 512.

  • If I try to set the sector and head count using -S 64 -H 32, for example, then it always sets the sector count back to 63, which doesn't divide evenly into 4096 (I know, 32 dividing evenly by 8 is technically enough, but - call me perfectionist - I'd really like to have the partition start at sector 2048 (1MB aligned), as I read is the recommended setting these days.


Is there some combination of parameters that I can pass to fdisk, that will allow me to create a partition that starts at 1MB (sector 2048 [256] for 512-[4096-]byte sectors) and is exaclt 2TB long (3,906,250,000 [488,281,506] sectors for 512-[4096-]byte sectors)?


(I read that I can just use gparted and have it change the drive to GPT partitioning, but I'd really like to know if there is a way to do it with standard fdisk and an MBR partition. I don't see a reason why MBR partitions shouldn't allow for this...)



Answer



UPDATE:


Newer versions of fdisk (e.g. v2.20.1) do not have the issue of truncating the cluster number as described in the question any more. Therefore, one can now simply use


fdisk -c /dev/sdX

to create a partition starting at 2048 and ending at 3906252047 to create the desired layout.


ORIGINAL ANSWER:


I found one way to do it:


fdisk -S 16 -H 1 -c /dev/sdX

Then, I can create a partition that starts at 129 and ends at 244,140,753.


Now, if I do fdisk -l -u /dev/sdX, I will get:


Disk /dev/sdX: 2000.4 GB, 2000365289472 bytes
1 heads, 16 sectors/track, 244185216 cylinders, total 3906963456 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
Disk identifier: 0xee3e796d

Device Boot Start End Blocks Id System
/dev/sdX1 2048 3906252047 1953125000 fd Linux raid autodetect

and blockdev --getsize64 /dev/sdX1 gives me exactly 2,000,000,000,000.


Now the big question: Does anyone see a problem with the -S 16 -H 1? :)


Using the “Combining Enclosing Circle” character in Word


Is there a way to use the “Combining Enclosing Circle” UNICODE character (U+20DD) together with some other character in Word 2010 to actually form a circled character? There are glyphs for e.g. circled digit one (“①”), but I need circled Latin capital letter A.



Answer



One trick to do this is to adjust the tracking. In Word (2007), you can highlight the two adjacent glyphs, go into the Font dialog, choose the character spacing tab, set "spacing" to "condensed" and "by" field to something such as 10pt. Check the preview for alignment.


This essentially sets the spacing between the two glyphs to a negative amount, causing the second one to overlap the first one. If you change the typeface or size, you will need to tweak it.


linux - How to add EFI entry by efibootmgr?

I installed stand alone Ubuntu on my laptop by formatting the HDD. Now HDD is not in my EFI menu. From a Live USB environment, I added the EFI entry, even by chroot. However, the EFI menu is reset to the original after shutdown.


Upon restarting the computer, booting from HDD works, as EFI HDD is still on the list, but if shutting down the computer, the menu would be reset.


How can I add EFI HDD entry to the EFI menu permanently?


NOTE: my BIOS setting is very simple with almost no option to be changed in this regard. This is about efibootmgr commands.


UPDATE: I am booting into HDD now, but strangely on every boot I add a HDD entry via efibootmgr and the previous one is removed upon rebooting. This means that every EFI entry has a lifetime of one rebooting.


This is output of efibootmgr -v


BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0003,0004,2003,2001
Boot0001* UEFI: IP4 Realtek PCIe FE Family Controller ACPI(a0341d0,0)PCI(1c,2)PCI(0,0)MAC(0c54a5b1f8be,0)IPv4(0.0.0.0:0<->0.0.0.0:0,0, 0..BO
Boot0002* UEFI: IP6 Realtek PCIe FE Family Controller ACPI(a0341d0,0)PCI(1c,2)PCI(0,0)MAC(0c54a5b1f8be,0)030d3c000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000..BO
Boot0003* Ubuntu 7 HD(1,800,100000,0af63fdd-2949-4624-8410-9889ab0360a0)File(\EFI\ubuntu\grubx64.efi)
Boot2001* EFI USB Device RC
Boot2003* EFI Network RC

The strange thing is that UEFI does not detect the HDD.

powershell - How to check if windows has automatic updates waiting from the command line?


If a Windows server (2k3/2k8) is set to "download but not install" updates, is there a way to check from the command line.. perhaps a log file or something I can check with powershell, to see if there are any updates actually waiting to be installed? I'm trying to prevent having to manually log on to each server to check, even though they want the "trigger" pulled manually. We have an automation system in place I can use (CA Autosys) - just not sure what to have it look for.



Answer



We can use IUpdateSearcher::Search to determine the number of yet to be installed updates:


$session = New-Object -com "Microsoft.Update.Session"

$searcher = $objSession.CreateUpdateSearcher()

$results = $objSearcher.search("IsInstalled=0")

$results.updates.count

If you need to do installation by another script, assign the above variables first and add:


$installer = New-Object -com "Microsoft.Update.Installer"

$installer.Updates = $results.updates

foreach ($update in $objresults)
{
$objInstaller.install()
}

How to remove icons from a toolbar in firefox


I've just updated my toolbar in Firefox, I accidentally hit restore default button, which brought back the default set.


There are two icons, namely Home and Download, that I don't need - but I can't figure out how to get rid of them.


I've tried dragging them off the side when in 'customize toolbar' mode, but they won't go away, any ideas ?


Firefox toolbar example



Answer



Right-click on the toolbar (not inside the search bar or the address bar) and select "customize" from the menu, then you will be able to drag and drop the desired icons on the toolbar.


Specifically, to remove them from the toolbar, you don't have to "drag them off the side", but drag them inside the new window that will be opened and that contains all available icons.


Thursday 28 September 2017

email - Is IMAP (un)subscribe meant to work across mail clients?


I read my IMAP-mail on different computers/mail clients. I wanted to unsubscribe from the majority of my folders in Outlook. Later, I noticed that on another computer, where I use Thunderbird, I was also unsubscribed from those folders as well. This is not what I wanted (at all), so I subscribed again under Thunderbird. The effect was that I also got subscribed again under Outlook.


So I guess this means (un)subscribing to IMAP folders is an account-coupled thing, not a per-client thing. Is there a way to achieve (un)subscribing per client?



Answer



IMAP subscriptions are handled and stored by the IMAP server, so your subscriptions will be the same regardless of which client you use. So I doubt you're going to find a client that can unsubscribe only for itself.


Perhaps check out the SU question What does it mean to "subscribe" to an IMAP folder? for more info.


windows 7 - Two external displays from one laptop with VGA and HDMI?


I have Sony VGN-FW560F with ATI Mobility Radeon HD 4650. I would like to hook up two external monitors to a laptop's Hdmi and Vga. The laptop graphic card normally only support 2 displays and I want those two displays on the external ones. I don't want to use USB to VGA adapter. Is it possible?



Answer



It's almost possible... I have hacked(literally) the VGA head which is very close to HDMI port for both VGA and HDMI to plug at the same time. I disable the laptop monitor and close the lid and try to enable the both external monitors. Alas, my graphic card model is one series below to achieve that since someone with ATI Mobility Radeon HD 5470 is able to do that following the same route. http://forums.overclockers.co.uk/showthread.php?t=18404870


How do I get chrome to stop prompting me when downloading PDFs?




Possible Duplicate:
Google Chrome Annoying Download warning



Chrome warns me every time I download a PDF from Gmail and I always click 'Save'. Is there any way to stop this warning?


enter image description here



Answer



Currently there is no way to remove the warning. There is however an ongoing discussion about it on the chromium issue tracker (open source project behind Chrome).


You can instead force Chrome to ask you where to save the file (Chrome Options -> Under the hood) and right-click links then choose "save as".


Sharing OneNote 2010? Desktop and Laptop and the Web(Skydrive)?

I love Onenote and have 2010. I've been able to sync Onenote on my laptop and skydrive, but would like to add a desktop with the onenote client to to sync with as well (not use web).


Onenote will only give me two choices for sync: a)web or b)network. I can't do both.


Does anyone have any solutions on how I can sync all 3, and be able to edit on all 3?


Thanks

macos - Set the title of the terminal window to the current directory


How can I get the Terminal.app in OS X to display the current directory in its window or tab title?


I'm using the bash shell.



Answer



Depends on your shell.


This article displays multiple methods.


I personally use zsh which has a convenient precmd() function which is run before each prompt.


    precmd () { print -Pn "\e]2;%n@%M | %~\a" } # title bar prompt

Although the other questions list bash methods, they alias cd. Bash provides an inherent method that chains off just the prompt.



bash


bash supplies a variable PROMPT_COMMAND which contains a command to execute before the prompt. This example (inserted in ~/.bashrc) sets the title to "username@hostname: directory":



 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'


where \033 is the character code for ESC, and \007 for BEL. Note that the quoting is important here: variables are expanded in "...", and not expanded in '...'. So PROMPT_COMMAND is set to an unexpanded value, but the variables inside "..." are expanded when PROMPT_COMMAND is used.


However, PWD produces the full directory path. If we want to use the '~' shorthand we need to embed the escape string in the prompt, which allows us to take advantage of the following prompt expansions provided by the shell:



\u          expands to $USERNAME
\h expands to hostname up to first '.'
\w expands to directory, replacing $HOME with '~'
\[...\] embeds a sequence of non-printing characters


Thus, the following produces a prompt of "bash$ ", and an xterm title of "username@hostname: directory" ...



 case $TERM in
xterm*)
PS1="\[\033]0;\u@\h: \w\007\]bash\$ "
;;
*)
PS1="bash\$ "
;;
esac


Note the use of [...], which tells bash to ignore the non-printing control characters when calculating the width of the prompt. Otherwise line editing commands get confused while placing the cursor.



Installation of Windows XP stuck at "please wait..." with 500g HD

I just have the computer upgraded to a SATA 500g WD HD, but I'm stuck after this stage:


enter image description here


After I pressed "ENTER" the computer frozen at "Please wait..." message. No disk or memory operations ever since.


The BIOS recognized the HD by displaying the HD model in POST and the installation disk worked previously. Any ideas?

How to disable search in the Google Chrome address bar?




Possible Duplicate:
Force Chrome to open URLs as URLs, instead of searching



I'm surprised that I haven't found this question on superuser. Forgive me if it's a duplicate, but how do you disable the search functionality in Google Chrome's address bar?


I want it to be just a straight up address bar. I know the address where I want to go. I don't want to have to click the "did you mean to go to" link all the time when Chrome thinks the word I typed is more likely to be a search term than a server. You'd think putting the http:// in front would help, but I already do this by default anyway and no dice. =/


Thanks!



Answer



You can't disable the search feature of the Omnibox.


You can disable instant search by clicking the wrench > options > basic and unchecking "enable instant."


A possible work around is to create a custom search engine for chrome. Right click in the Omnibox (search bar) and choose Edit search engines. You can create a blank search engine that will always fail by putting "no" "null" and "http://%s" in the Name, Keyword, and URL fields respectively.


If you're trying to point this to a local host, you could potentially use the URL field for this, though I have not tried this, and cannot confirm.


internet - How to remove ad-type.google.com pop ups from **PC**? (Tradeadexchange redirection.)


Okay, it seems that my router is infected. Whichever device I connect with my router, gets this pop ups. I remember, I managed to free atleast my PC, of this virus. But it again has come back and irritates and annoys me so much. Is there a long term solution?
Everytime I click something, even if it is a button, a text field or nothing at all (on the page), the pop up appears.



Answer



Go to "change adapter settings" and then to properties for your router. Then click on "IPv4" properties and change the DNS to preferred one "8.8.8.8" (Google's Server). It will solve the problem!


windows 7 - Realign Remote Desktop session icons to physical desktop's


Somehow, the desktop icons for a workstation that i frequently Remote-desktop into has been rearranged to the right side. I don't know how/when that happened, but only discovered when I minimised all windows (which i seldom do).


enter image description here


The good thing is, when i log on physically to the workstation, the desktop arrangement is back to the regular alignment. So there is a "disconnect" between Windows 7's physical layout vs virtual RDP layout.


Now the question is, how is it possible for me to get the RDP layout to "reset" and follow the physical alignment again?



Answer



There is really no such thing as "physical" or "RDP" layout, or one layout "following" another. There are only different screen resolutions, each of which has its own icon positions stored in the registry at:


HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop

For example, if your screen (whether RDP or physical) is 1280x1024, the positions are stored in the value ItemPos1280x1024(1). Delete it and the icons will be put in the default places.


microsoft powerpoint - How to set all text in all slides to the same font?


I'm making a presentation that's looking a lot like the Frankenstein monster right now. There are 4 different fonts being used throughout all the slides, and I'd like to normalize this. I want to set all the text to the same font.
How can I do that?


I tried simply selecting all slides, but then you can't select the Font menu (and that's as far as my PowerPoint experience goes).



Answer



Select all the slides (Ctrl+A) using the Outline view. You can then change the Font for the selected text.


macos - Hide users from Mac OS X Snow Leopard logon screen


Somehow, I managed to set a passwd for my _postgres user on my OS instead of setting it on the postgres role I have as my superuser / root. Anyways since this, I've been struggling with that user showing up in the account section and login screen, which I really would like to avoid. I've read through some docs about this, and setting the password to * should be all that is needed to fix this. But after several attempts doing this with and without dscl to no avail, I'm gotten to a point where I don't know what to do anymore.


I didn't think it would be even hard doing this, but clearly I'm missing something, so how do you do this?



Answer



The easiest method for hiding system users (if their user ID is < 500) in the login window is to run the following command:


sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE

Alternatively you can manually hide just the username by running


sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add '_postgres'

To hide the 'Others...' item from the login window if need be:


sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE

Wednesday 27 September 2017

cursor - Touchpad madness

Is anyone else having 'mouse' trouble on controlling a laptop touchpad? The cursor becomes uncontrollable. I used to own a floppy disc with these tricks for fun; but this has come to my machine unwelcomed and with malice. I suspect entry-by-cookie; but no system setting or AVG virus scan will detect or get rid of it. As you guessed, I'm no 'SuperUser'. There MUST be a simple toggle somewhere. Paleeeze help.


= Ancient Dell Inspiron 1100 running XP,SP2 = CPU 2.2 Ghz; 256MB RAM


It's hard enough to milk this machine as it is! But it's all I got.

My SanDisk USB flash drive shows that 43GB is used when I just copied a 10GB folder after formatting



I recently bought a SanDisk 128GB USB flash drive.


And after formatting the USB flash drive in exFAT format, I copied a folder whose capacity is around 10GB. There are lots of small files in it, so it took some time.


However, when I see in the Windows Explorer after copying the folder, it says that around 43GB of the storage is occupied and now only 70GB of the storage is free to use.


What is happening and how should I deal with it? Is my USB flash drive physically broken?


It is still weird because when I copied a single file with 7 GB capacity, it showed the remaining capacity correctly at around 110 GB available..



Answer



You already answered your own question: There are lots of small files in it


Every file on an exFAT volume takes at least one blocksize. So a file of a single byte in size takes at least 4K - a size amplification of 1:4096. You are seing a size amplification of 4.3, which is very plausible with lots of small files.


You can check this hypothesis by packing the files with WinRAR and the zero compression settings, then copy this file to the USB stick.


What happens when a computer goes to sleep?


Possible Duplicate:
What is the difference between (these four) sleep states?



What exactly (hardware and software-wise) happens when a computer goes to sleep? Do the actual processes turn off, just the screen?...What exactly happens?

memory - How to identify different types of RAM


Possible Duplicate:
Can you tell DDR and DDR2 apart visually?



I would like to know how to identify different types of RAM like:



  • SDRAM,

  • Dynamic RAM,

  • DDR,

  • DDR2,

  • DDR3,

  • DDR4

license - Serial Number and Product Number of laptop in Windows


How do I get the Product and Serial Number of ASUS EeePC netbook on Windows (XP preferably)?


Edit: I am not a label reader and I am interested to retrieve the two numbers by software or tool.



Answer



I can see two ways to do this:




  1. Type "msinfo32" on your "Run"(Windows Button+R). Search for "System Model" or "System Serial". Certainly you will find the information that you need here.




  2. SIW(System Information for Windows):




SIW is an advanced System Information for Windows tool that analyzes your computer and gathers detailed information about system properties and settings and displays it in an extremely comprehensible manner.


Or even a 3th option:



  1. If you until don't find what you are looking for, you would try looking over windows registry(Windows Key+R / "regedit"), go to HKLM\HARDWARE\DESCRIPTION\SYSTEM. There is a lot of information about your system an about your BIOS here.


boot - How to log in to WIndows after disabling all services?


I disabled all services and startup applications and now the computer won't let me log in. It will get me to the initial startup screen, but it won't connect to the Internet. Then when I click or press a key to log in, the password box never appears.


How to go back to normal boot? Shift+Restart or F8 to get into safe mode doesn't work. Restoring to a system restore point resulted in an error. Even Resetting Windows didn't work.



Answer



There are two ways to access safe mode boot without having to logon:



  1. Interrupt Windows booting process four times

  2. Open Command Prompt from an installation disk, enter bcdedit /set {default} safeboot minimal, then restart


After that, you can open msconfig and undo what you've done.


Source: 7 ways to boot into Safe Mode in Windows 10


Strange directory under C: of Windows 7




Possible Duplicate:
Windows Updates Folders (With Strange Names) in C drive



I have a folder named "ed6b7b66d9c1d645bfce0f8b33c3" under C: of Windows 7. I was wondering what its purpose is and if it is safe to delete? Thanks!


It takes up 120 MB. Its content is as follows: enter image description here



Answer



Googled the KBxxxxxx numbers, shows that the folder contains a .NET Framework setup.


It is safe to delete as it is solely an installer...


Method/product for cleaning cigarette smoke off of LCDs?

OK, I admit I am a smoker. Im trying to quit, its hard though...


So I have several LCD monitors that have accumulated grime from cigarette smoke over the years. Every so often I take a soft cloth and dip it in mildly soapy water. I gently wipe the screens down to clean them. It works, however its an extremely slow and tedious process, as it takes many passes to get the screens clean.


Is there a better alternative out there? Is there a home 'remedy,' or even a tested commercial product?

utorrent - is it possible to convert direct link to torrent?



how to convert direct link to torrent ?


when you want to create torrent file, you just select your file from your computer and torrent file has made but i want to make torrent file from a direct link.


is it possible ? if yes , what's the procedure ?



Answer



Burnbit is a free web service that does just that. Here's a bit more background information and commentary on the service, and the official FAQ.


I've never used the service, but was also curious about your question. I stumbled across Burnbit when researching it.


Is it plausible that an interrupted Windows update can cause the motherboard to fail?


When I turn on my Windows 10 desktop (a Dell XPS 8920 Desktop), and after the latest Windows Update I get a black screen. There is no splash logo or anything - the screen is completely black at all times. When powered on the computer starts up, then I can hear after 17 seconds (I timed it) that it reboots, and the process repeats endlessly.


I've discovered that I can get into the BIOS screen if I press F12 as the computer's restarting. I can't see that I'm in BIOS because the screen stays black but it seems clear to me that I am, because I get predictable outcomes by pressing certain keys (e.g. If I press F10 to save and exit the BIOS, I can hear the computer make a restarting noise). However, restoring the BIOS to factory defaults doesn't fix anything.


After I called out a repairman in relation to the problem, the repairman has suggested to me that the problem was caused by a power outage during a Windows Update, which has then corrupted the motherboard, and that the solution is therefore to replace the motherboard.


The motherboard is being replaced at no charge to me as the machine is under warranty, so the claim isn't a self-interested one.


But still I wonder if this is plausible.


The power outage was caused by a tradesman turning off the power at the mains when the computer was being updated. I am also using a surge protected powerboard so I doubt that a power surge is the issue. I also have now seen that the computers fails a POST test even with the GPU replaced, and it also did not beep when the CMOS battery was removed and put back in place.


Update: After the motherboard was replaced the screen started working, although now the system does not seem to recognize Windows anymore. The current plan is that I'll be given a replacement SSD (as with all the service and parts so far, I'm not being charged for this) and instructed just to install Windows again.



Answer



(The answers given by others are, I think, wrong).


Although somewhat unlikely this is possible. Manufacturers can indeed get Windows to update firmware and UEFI during a Windows update, and if this process is interrupted you could indeed hose a motherboard.


See https://docs.microsoft.com/en-us/windows-hardware/drivers/install/updating-device-firmware-using-windows-update to read it "from the horses mouth"


How can I share only one window with TeamViewer?

I would like to share only one window through TeamViewer under Windows 7, not the entire desktop. How can I achieve this?

Tuesday 26 September 2017

Windows Explorer crash on right-click since last Update

Yesterday I installed the pending updates from a week ago or so.


Since then Windows Explorer crashes when right-clicking any item. (The only item where it didn't crash on was on Computer.)


The event log shows:


Faulting application name: Explorer.EXE, version: 6.1.7601.17567, time stamp: 0x4d672ee4
Faulting module name: KERNELBASE.dll, version: 6.1.7601.24441, time stamp: 0x5cb935a7
Exception code: 0xc06d007e
Fault offset: 0x000000000000bdfd
Faulting process id: 0xff8
Faulting application start time: 0x01d51fa5574ad043
Faulting application path: C:\windows\Explorer.EXE
Faulting module path: C:\windows\system32\KERNELBASE.dll
Report Id: dc15feee-8b99-11e9-9549-a41731b5c9d4

Any suggestions on what I can do?

login - Does the Windows Task Scheduler have a way to run a command a set time after the user logs on?


Does the Windows Task Scheduler have a way to run a command a set time after the user logs on?


I prefer it to run the first time anybody logs on, whether manually or if the computer is set to logon a particular user automatically.



Answer



In Windows-7



  1. In task scheduler you can create a task.

  2. On Triggers tab you click 'New' and from the 'Begin the task' drop down menu choose 'At log on'.

  3. Below on the form tick 'Delay task for' check box and choose the delay value.


This should do the job.


windows - Multiple versions of Internet Explorer on a machine


Is it possible to have multiple versions of Internet Explorer on the same computer?



Answer



Microsoft now provides free virtual machine images with a number of different versions of Internet Explorer preinstalled. You can grab a copy of the images on the modern.ie website, which currently includes the following combinations:



  • IE6 on Windows XP

  • IE7 on Windows Vista

  • IE8 on Windows XP

  • IE8 on Windows 7

  • IE9 on Windows 7

  • IE10 on Windows 7

  • IE10 on Windows 8

  • IE11 on Windows 8.1

  • IE11 on Windows 7

  • IE11 on Windows 10


The images are designed for the following virtualization platforms:



  • Microsoft Hyper-V

  • Microsoft VirtualPC

  • Oracle VirtualBox

  • Parallels

  • VMware


The images expire after a fixed amount of time, so snapshots are recommended to simplify the process of "resetting" them after they expire.


Screenshots


IE6 on Windows XP IE8 on Windows 7


Showing Hidden Files as Hidden in Windows from Linux Samba Share of NTFS Drive


I have a Raspberry Pi which is using samba and ntfs-3g in order to share a USB external hard drive on my home network. On the hard drive, there are some files which are marked with the "Hidden" Windows file attribute. However, when I access the share on a Windows PC, the files do not show as hidden. As a result, I see many hidden files such as desktop.ini, thumbs.db, as well as directories like $RECYCLE.BIN and System Volume Information, even though my Windows setting in Folder Options is set to not show hidden files.


I know that samba is not correctly transferring the Hidden attribute because if I view the Properties of a file that should be hidden, the Hidden check-box is not selected:


Not hidden


These are the current contents of my smb.conf file:


#### GLOBAL CONFIG #####

workgroup = WORKGROUP
netbios name = raspberrypi
server string = %h
wins support = yes
dns proxy = no
security = share
null passwords = yes
guest account = nobody
interfaces = eth0 lo
bind interfaces only = yes

#### PUBLIC SHARE #####

[Mazda6]
comment = Media Drive
path = /media/HDD
browseable = yes
guest ok = yes
writeable = yes
public = yes
available = yes
create mask = 0666
directory mask = 0777

How can I have files that are marked with the Hidden file attribute on the NTFS drive to be shown as Hidden when viewed through the samba share on a Windows PC?



Answer



I believe -- but have not tested myself -- that you need only add map hidden = yes to the configuration for your share. Note that this may have the unintended/undesired behavior of making "other executable" files (per the Linux file permissions) rendered "hidden" in Windows as well; this is because Samba in effect repurposes that bit to be the "hidden" attribute for Windows, as it resides on top of Linux which has no such attributes.


Failing that, you should be able to use the hide files option to hide the files you specify; for example, you apply this to your share's config:


hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

The downside here, of course, is that you must hard-code the files you want hidden explicitly in your config, and unfortunately there's no way to distinguish between e.g. a desktop.ini that should be hidden, and a desktop.ini that should not be hidden -- both will be hidden with this setting. (NOTE: I'm unsure if this will work with directories; I believe it should, but cannot test it at the moment. There may also be issue with the $ character; again, I think it will work, but I'm not able to test it right now.)


As always, the documentation is your friend.


Update: Per the OP's testing as reported in the comments below, it seems all files on an NTFS partition may show up in Linux with 0777 permissions; since this means the "other execute" bit is set, Samba ends up interpreting every single file as "hidden" with the map hidden setting turned on, rendering that solution untenable without first moving all data to a different file system.


Batch file - wait or quit if a process running


I have 2 small batch files that change the target location of a junction point (mkref /d), in order to switch between 2 iTunes libraries.


It works well, but I would like it to stop if iTunes is already running - as iTunes will overwrite the library in the wrong target folder if I change the junction while it is running.


Is there a way to quit or pause the batch file if iTunes.exe is running?



Answer



Try adding the following to the beginning of your batch files:


tasklist /fi "Imagename eq itunes.exe" 2>NUL | find /i /n "itunes.exe">NUL
if "%ERRORLEVEL%"=="0" exit

For more information, see the documentation on the tasklist and find commands.


How to enter formulas in Excel in other locales (with different decimal separators)?

I'm getting a strange error in Excel where I cannot enter formulas:


=ROUND(1.5,0)

gives an error:



The formula you typed contains an error



enter image description here


I presume it has something to do with the (red herring) fact that I am in a locale that uses:



  • . for decimal point

  • , for digit grouping

  • ,, for list separation


enter image description here


How do I enter these formulas in Excel?




Update: semi-colon doesn't work:


enter image description here

windows - Editing the hardlink doesn't edit the original file

I have a file at D:\JavaScript\CheckIban.js, and I want to reuse it in many places without duplicating it. Because when I fix a bug (change its content) I need that change to be propagated to all files. Using links my plan is to change one instance of the hardlinks, and expect other instances to be updated automatically.


Now, let's say that I've create a hardlink to this file using:


mklink /H D:\Projects\Crm\Site\Scripts\CheckIban.js D:\JavaScript\CheckIban.js


and I get the success message that the hardlink is created for ...


However, when I open each file and change it, the content of the other file is not changed. What do I miss here?


Notes: I can't use soft links, because I'm using a program (TFS) that doesn't support working with soft links.

how to write superscripts before symbols in equation mode in MS Word?

I know that using caret you could do this after the symbol but what is the way to do it for having a superscript before a letter? if there is a shortcut for this id appreciate if you let me know that as well. thanks!

linux - Setting up ssh config file with id_rsa through tunnel


I've been struggling to set up a valid configuration to open a connection with a second machine, passing through another one, and using an id_rsa (which requests me a password) to connect to the third machine.


I've asked this question in another forum, but I've received no answer that could be considered very helpful.


The problem, better described, goes as follows:


Local machine: user1@localhost
Intermediary machine: user1@inter
Remote target: user2@final

I'm able to do the entire connection using pseudo-tty:


ssh -t inter ssh user2@final

(this will ask me the password for the id_rsa file I have in machine "inter")


However, for speeding things up, I'd like to set my .ssh/config file, so that I can simply connect to machine "final" using:


ssh final

What I've got so far -- which does not work -- is, in my .ssh/config file:


Host inter
User user1
HostName inter.com
IdentityFile ~/.ssh/id_rsa

Host final
User user2
HostName final.com
IdentityFile ~/.ssh/id_rsa_2
ProxyCommand ssh inter nc %h %p

The id_rsa file is used to connect to the middle machine (this requires me no password typing), and id_rsa_2 file is used to connect to machine "final" (this one requests a password).


I've tried mixing up some LocalForward and/or RemoteForward fields, and putting the id_rsa files in both first and second machines, but I could not seem to succeed with no configuration whatsoever.


P.S.: the thread I've tried to get some help from:


http://www.linuxquestions.org/questions/linux-general-1/proxycommand-on-ssh-config-file-4175433750/



Answer




If you want to retain the authentication flow


local -- authenticate --> inter -- authenticate (ask password) --> final

This cannot be done with .ssh/config proxyhost.


What you need is bash shell alias (I hope you are using bash).


In ~/.bashrc, add following line


alias ssh-final='ssh -t inter ssh user2@final.com'

In command prompt, just type following


ssh-final

final section in ~/.ssh/config is not used.


Connection Details(1)


ssh -t inter ssh user2@final.com can be view as follow


local# ssh inter
inter# ssh user2@final.com

local is only "talking" to inter. There is no direct or indirect ssh connection between local and final. local is just displaying the output of ssh user2@final.com.



Authentication with same ssh-key


Host inter
User user1
HostName inter.example.com

Host final
User user2
Hostname
Port 22
ForwardAgent yes
ProxyCommand ssh inter nc %h %p

Copy local ~/.ssh/id_ras.pub to


/home/user1/.ssh/authorized_keys in `inter`
/home/user2/.ssh/authorized_keys in `final`

Connection Details(2)


ssh tunneling


Before we go into detail of ProxyCommand, lets look at the following example


Step 1, on terminal window 1


local# ssh inter -L 2000:final.com:22

Step 2, on terminal window 2


local# ssh localhost -p 2000

In terminal 1, a tunnel is setup between local port 2000 and final.com port 22. Anything sent to local port 2000 will be forward to final.com port 22 and vice versa.


In terminal 2, ssh connect to local port 2000, but actually is communicating with final.com port 22, which is the sshd.


With tunneling, local ssh client in Step 2 is connected with final.com sshd directly.


The "output" of local port 2000, is "raw" ssh daemon traffic.


Common usage of such tunnel is to access internal web server or email server. Following is example for web server


local# ssh inter -L 2000:final.com:80

In the browser use following URL


http://localhost:2000

The two end points of the tunnel are local port 2000, and final.com port 80.


Traffic coming in and out of tunnel end point "AS IS". Lets call that "raw" traffic.


ProxyCommand


Host final
User user2
Hostname
Port 22
ForwardAgent yes
ProxyCommand ssh inter nc %h %p

The ProxyCommand take it one step further. It skip the step of creating a local port and connect to it.


A ssh client will execute what ever command given behind ProxyCommand, and treat the output of that command as "raw" traffic. It is holding onto the local end point, and then start a ssh connection with it.


Why one work the other does not?


The following command


ssh inter nc final.com 22

basically means (1) connect to inter, then (2) on inter, run command nc final.com 22.


nc - arbitrary TCP and UDP connections and listens

So nc final.com 22 will connect to final.com port 22, print out all incoming traffic to stdout, and send all stdin to the other side. It is a "tunnel" between nc stdin/out and final.com port 22.


Since nc is ran within the ssh session, all its stdout is passes back to the ssh client, as "raw" traffic. And the ssh client can pass traffic into nc stdin, which will end up at final.com port 22.


Through the above "tunnel", local ssh client will start a ssh session with final.com directly.


The following command


ssh -t inter ssh user2@final.com

does not work with ProxyCommand because the out of it is not "raw" traffic from a ssh daemon. It is the stdout of a ssh client. Client talk to client means no business.


Authentication with different ssh-key (OP original config)


Host inter
User user1
HostName inter.com
IdentityFile ~/.ssh/id_rsa

Host final
User user2
HostName final.com
IdentityFile ~/.ssh/id_rsa_2
ProxyCommand ssh inter nc %h %p

Copy local ~/.ssh/id_ras.pub to


/home/user1/.ssh/authorized_keys in `inter`

Copy local ~/.ssh/id_ras_2.pub to


/home/user2/.ssh/authorized_keys in `final`

Both of the above will enable the following usage


local# ssh final


Use verbose


local# ssh -v final

That should help identifying ssh problem.


Check nc


ProxcyCommand is executing nc on inter. Check if nc is actually available on inter.


local# ssh inter
inter# nc final.com 22

Check rsa key is setup properly


If different keys are to be used for inter and final, following files should exist in local machine


local# ls ~/.ssh
id_rsa id_rsa_2 id_rsa.pub id_rsa_2.pub

Since you can ssh to inter already, check key setup on final. From your local machine


local# ssh -t inter ssh user2@final
final# cat .ssh/authorized_keys

You should see content of id_rsa_2.pub there.


Do user-specified shortcut keys for Windows only work on certain directories?


I am trying to mute my computer's speakers by pressing a shortcut key. My keyboard doesn't have a button for 'Mute' or any other extra multimedia buttons.


With my keyboard, I mute my computer by creating a shortcut to NirCmd with the mutesysvolume 2 argument (toggle mute on/off). I then assigned this shortcut, a shortcut key of Ctrl + Alt + M by right clicking the shortcut > Properties > Shortcut > Shortcut key.


However, this only works if I create the shortcut file in the desktop or a subfolder in the desktop.


I initially tried creating the shortcut in the NirCmd directory in the Program Files folder, but no luck - the shortcut key doesn't work (but the shortcut does). I also tried creating the shortcut in a subdirectory one level under C:\, still to no avail. I then tried creating the shortcut at one directory level under C:\Users\username but the shortcut key still doesn't work. The shortcut keys won't work even if I move the shortcut file (.lnk) to the desktop.


I tried moving nircmd.exe to the Windows directory so I could call it without specifying the directory, but I still get the same issues above.


Anyone know the reason why the shortcut key does not work if I put the shortcut file in the directories I mentioned?


I am using Windows 7, 64-bit with the 64-bit version of NirCmd.



Answer



It must be in the Start menu folders or the Desktop.


As per the Microsoft Support page, Shortcut key for shortcut does not work:



Symptoms


You are unable to run a shortcut by pressing its shortcut key.


Cause


Shortcut keys work only for shortcuts on the desktop or in the Start menu hierarchy.


Resolution


Make sure that the shortcuts for which you want to use shortcut keys are on the desktop, on the Start menu, or in the Windows\Start Menu\Programs folder.


More Information


Shortcut keys work differently depending on the location of the shortcut. If the shortcut is on the desktop or in the Start menu hierarchy, you can use its shortcut key to start the assigned program, or switch to the program if it is already running.


If the shortcut is not on the desktop or in the Start menu hierarchy, you cannot use its shortcut key to start the assigned program, but you can use its shortcut key to switch to the assigned program if it is already running.


NOTE: Shortcut keys may not work for some programs. For example, shortcut keys do not work for items on the Quick Launch bar.



windows 10 - OneDriveSetup.exe causes high CPU usage


On my Toshiba Encore 8 Tablet I noticed that the CPU usage is very high. In Taskmgr / ProcessExplorer, I can see that OneDriveSetup.exe is hogging 1 CPU cores heavily for hours.


enter image description here


How an I solve this hang and finish the OneDrive Update?



Answer



This is a known issue since End of June 2017 when users have non English/ASCII values in their username and therefore their profile paths (C:\Users\André, C:\Users\András or Cyrillic user name). OneDriveSetup.exe hangs with a single processor thread hogging one logical processor of the computer because it keeps retrying file operations that are failing because of the non-English/ASCII characters in the user profile paths. Use these steps to fix it:



  1. Kill the OneDriveSetup.exe in Task Manager/Process Explorer; This step is optional, OneDriveSetup.exe will most likely recover from the hang and continue after step 2 even if you don't kill it (step 1) and run it again (step 3).

  2. Go to the %localappdata%\Microsoft\OneDrive\setup\logs folder and find the following two files
    UserTelemetryCache.otc
    UserTelemetryCache.otc.session
    (if you can't see them, make sure all hidden & system files are visible)

  3. Now delete those 2 files and go to %localappdata%\Microsoft\OneDrive\Update and run the OneDriveSetup.exe again.


Now the installer no longer hangs in a loop, finishes fine and the CPU usage is gone.


windows xp - Different font rendering in same computer


While I was writing some stuff here on Super User, I had to use my alternate guest account to write. I then noticed that the font that was present on the editing box and also in the '< code >' snippets was slightly off.


The font in both cases is Consolas. I have checked it through the Inspector tool in Firefox. Here is what it appears on both accounts, using the "The quick brown fox jumps over the lazy dog" expression. The font on the guest account seems a lot coarser and bolder than the thin font I've become accustomed to working to, despite being the same.


Visual comparison between fonts


Why is this happening and how can I change it so that it matches the User Account font? I am using Windows XP.



Answer



After concluding that the font is the same and that its rendering was the only thing off, I checked the Wikipedia entry on the font. Consolas is a font designed and bundled with the newer Windows systems, that is also bundled with certain Microsoft Office products that I might have installed.


One of its key features is the use of the ClearType rendering technology. ClearType attempts to improve the rendering of the font by sacrificing color fidelity for additional intensity variation. I was under the impression that ClearType was only implemented on Windows Vista and later, when Wikipedia corrected me: ClearType does exist within Windows XP, it just isn't turned on by default.


After some search, this Microsoft KB page appeared, detailing how to enable ClearType on Windows XP. Quoting:



To use ClearType for screen fonts:



  • Click Start, click Control Panel, click Appearance and Themes, and then click Display.

    • On the Appearance tab, click Effects.

    • Click to select the Use the following method to smooth edges of screen fonts check box, and then click ClearType in the list.





As it turned out, the Guest Account had the last option turned on, on the Default setting. Simply disabling the option and applying the changes worked and restored the font rendering.


windows 7 - Share desktop monitor/keyboard/mouse with laptop

I have a desktop PC running Windows 7 setup on a traditional desk. From time to time, I would like to plug in a Windows 7 laptop and share the keyboard and mouse, (monitor - I am ok with using the laptop monitor).


What is the easiest way to achieve this? Using a KVM switch? Without needing to reboot either machine?


Thanks

laptop - How can I thoroughly test all the hardware on my computer?


Here's what would be ideal:



  1. A list of all the hardware components potentially found on one's computer

  2. A method (or list of methods) for testing each of these

  3. The accuracy of these methods


My personal requests are:


-How to test your motherboard
-How to test your wireless receiving apparatus
-How to test CD/DVD-RW drive
-How to test your laptop battery
-How to test your Heat sink(s)?
-How to test the effectiveness of your fan(s)

Favorite answers: OS-independent tests which GUARANTEE the concerned hardware works PERFECTLY



Answer



No test suite can guarantee that anything works perfectly, they can only tell you if the computer passed the tests.


This Live-CD does some of it, I have never seen anyone test the CD/DVD or wifi. But any live-cd meant for ordinary use should allow you to test that manually.


StressLinux



StressLinux is a minimal linux distribution running from a bootable cdrom (LiveCD) or via PXE. Stresslinux is dedicated to users who want to test their system(s) entirely on high load and monitoring the health.


Features:



  • stress 0.18.1 (A tool to impose certain types of stress on a POSIX system.)

  • CPUBurn 1.4 (CPU maximum load (heat) stability test)

  • CPU Burn-In 1.00 (CPU burn-in test)

  • nbench 2.2.1 (CPU test suite)

  • iometer 2003.12.16 (I/O performance meter)

  • hddtemp 0.3beta11 (A program to display the temperature of your hard drive.)

  • lm_sensors 2.8.7 (LM78 and other hardware monitor drivers.)

  • busybox 1.0.0rc3 (Single small executable which contains common UNIX utilities)

  • lshw A.01.07 (Hardware lister)

  • bonnie++ 1.03a (Hard drive benchmark)

  • netio 1.23 (Network benchmark)

  • smartmontools 5.32 (S.M.A.R.T. drivetests)

  • x86info 1.12b (CPU information)

  • memtest86 3.1a (A stand-alone memory diagnostic)

  • memtest86+ 1.15 (An other stand-alone memory diagnostic)



networking - Why does my modem takes many attempts to connect to internet

I have this old DSL 502T Dlink modem router(wired). I have been using this for many years without any issues.


Recently though, there is issue connecting to the Internet (WAN side). It takes many attempts (restarts of modem) to connect to the internet for the first time, that is when my PC and Modem are started. It takes minimum 3-4 restarts of modem to get an internet connection working. Otherwise, the WAN connection remains disconnected, although the internal LAN works.


I have tried starting Modem first before PC, and also PC first before modem but this does not resolve the issues. Also, once the WAN(Internet) connection is obtained, it remains stable throughout the day without any issues.


Please help me resolve this issue. Here is how the system is configured.


2 Personal Computers connecting to a Switch (or Hub) Switch connected to Modem, which is connected to Internet Service Provider through a Telephone Line (ADSL)

Monday 25 September 2017

microsoft outlook - Why does my Tray Icon's Behavior occasionally reset Windows 7?

I'm fine with having most of my tray icons hidden, however I want the Outlook Notification envelop to show at all times when I have new messages. Its important for me to know when I have unread emails, as I often miss seeing them come in and they are often important.


I'll change the settings to Show Icon and Notifications, however it randomly seems to reset itself every few days or weeks back to Only Show Notifications


enter image description here


For example, it was working fine this morning, appearing when I had an unread message in my Inbox, and then it suddenly stopped working again. I only noticed it because I went to send an email and realized I had unread messages. I've only been here a few hours, so haven't signed off, locked my machine, rebooted it, or restarted Outlook.


Here's a picture of how my Task Bar usually looks. I don't like the Windows 7 big icons, and prefer two rows of items since I usually have multiple things open at once. I'm not sure if that setup has anything to do with why my Tray Icon behavior keeps getting reset or not.


enter image description here


Why is my Tray Icon behavior getting reset, and how can I stop it from happening?


Edit


I noticed that I got both Windows Security Updates, and Microsoft Office updates on this day. I am beginning to believe that this is a bug in either Windows 7 or Office which resets the default tray behavior when an update occurs. That would explain the seemingly random times that the behavior gets reset.


It should also be noted that when the envelop disappears, it still shows up in my tray icons, however the icon is hidden and I need to click the drop-down arrow to see it. This makes me think it's the Windows Updates causing the problem. Unfortunately, I didn't write down the days this has happened on in the past to see if it relates to other Windows or Office updates to be sure.

Adding Command-Line Switches To Windows Shortcuts

Is there a way to, in general, create a Windows shortcut to a file and instruct Windows to pass certain switches to the application before passing the filename?


For example: I have an Excel file, abc.xlsx. If I want to create a shortcut to open this file read-only, I would change the target to "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE" /r abc.xlsx, but this fails when another person on my network opens the shortcut and their EXCEL.EXE is not in that same folder.


Surely there's a way to tell Windows to pass the /r switch without supplying the path/filename of the application that is supposed to open the file?

Windows 7 boots only with installation disk in the drive

I have 2 hard drives - one on SATA and one on standard ATA. On the SATA drive I have Windows 7. I decided to do a fresh install on the ATA drive. Everything is ok apart from the fact, that the new install is booting only when the installation DVD is in the drive. When it's not, it boots the old installation on SATA drive. Does anyone know why it can be? My motherboard is Asus m2n-e.

intel core i7 - Triple vs. Dual Channel with 6 sticks of memory


Assuming a Core i7 with a x58 chipset (IOW, triple-channel is supported)... I'm trying to decide if I need to buy triple channel memory kits. The MB has 6 slots, and I will populate them all. So I've got two options:


1) Buy 2 triple-channel kits (3x2g sticks) identical kits


2) Buy 3 dual-channel kits (2x2g sticks) identical kits


Either way I have 6 identical sticks and 12Gig. And if the difference between dual and triple memory is in the controller, then I don't see the difference. Since I'm loading all 6 slots either way won't I end up with triple-channel access?


Everything I've seen on the net talks about 2 sticks vs. 3 sticks, and obviously 2 sticks can't do triple channel. However, with 6 sticks I should be ok regardless of how I buy them, yes?


FWIW, 12G purchased as 2 triple-channel kits will be ~$500, but 12G purchased as 3 dual-chanel kits would be $270. Big difference. Especially if I end up with triple-channel either way.



Answer



At one point, at wholesale, memory makers were changing designs by the week (well, month, but it felt very quick!), so if you bought in bulk from a supplier, even buying smallish quantities such as 10 sticks, you could get three or four different designs - it was a nightmare as dual channel (back then) didn't always work as some designs were to different (but the majority did work - you just had to find the right combination).


Dual channel kits simply bypassed this as they "guarantee" compatibility.


However, things seem to have settled down, and if you buy from the same company at one time, you usually do get the same sticks.


If I was you, just buy whatever it takes to get the amount of memory you want the cheapest way - so go for the 3 dual channel kits, or even see if you can buy the memory as individual sticks as I have not run in to problems for the past few years.


networking - Spring Update Windows 10 ssh client reverse tunelling not working


I'm trying to use the ssh client command available in windows 10 since the spring update.


I do not use the "OpenSSH Server" optional module and it is not installed, I'm using only the "OpenSSH client"


This ssh command seems to work correctly, I can connect to a remote linux ssh server, and even use ssh tunelling with the following command


ssh -L 8080:localhost:11111 user@remote

And then connect with my own application through localhost:8080 from the windows client.


But the reverse tunneling does not seem to work.the following command :


 ssh -R 8080:localhost:11111 user@remote

is working and the port is opened on my remote server, as show by nc on my remote linux:


nc -v 127.0.0.1 8080
localhost.localdomain [127.0.0.1] 8080 (http-alt) open

But the reverse tunnel is not working and I cannot communicate trough the tunnel.


Is this a bug in microsost ssh implementation ? Am I doing something wrong ?


I have completely disabled the windows firewall, have no other firewall installed and am connected on a private network.



Answer



There is definitely a bug in Microsoft OpenSSH implementation from 2018 Spring Update.


How to test it : On the local (Windows 10), install Python3, Putty and make sure ssh is available. Then




  1. Run a python http server in a terminal (on port 8000 by default)


    python -m http.server




  2. Create a reverse connection ssh tunnel


    ssh -R 8080:localhost:8000 user@remote




On the remote, connect trough the tunnel with telnet


>telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

The tunnel is still runnning but telnet disconnect almost instantly after the connection.


If you replase ssh by the plink.exe from putty, it works flawlessly and you can connect with a browser.


You can find my bug report here : https://github.com/PowerShell/Win32-OpenSSH/issues/1265


hard drive - How to incrementally backup whole HDD to external from Windows?


What I want exactly is a hard drive to hard drive incremental backup, not an image file. The original HDD has three partitons - ext3, linux-swap, and NTFS. What would be the easiest way to do this free?



Answer



Freebyte backup does incremental backups and is free software.



Freebyte Backup is a freeware backup program for Windows. It allows one to easily copy (and filter) a large number of files and directories from various sources into one backup directory. It is possible to backup all files found in the specified set of input directories, or to have only certain file types copied. Files can be filtered according to file-extensions. E.g. you can specify that you want to backup all .doc, .rtf, .jpg, .bmp files, but none of the .exe, .dll and .txt files. You can also very easily define new file extensions inside the filter.


Incremental backup options
With the optional 'Incremental backup' feature, the program only copies files which have not yet been saved by Freebyte Backup. It is also possible to specify a date, so that only files changes/created after a certain date/time are copied, or to only copy files if they are more recent than the corresponding files at the target location.



alt text


Why is the display resolution not exactly 16:9 or 4:3?


Most displays get advertised with either 16:9 or 4:3 display ratio. However, if you compare the resolution with the display ratio, it's most often neither of both.


For example, the resolution of my notebook display is 1366x768.
But 1366/768 = 683/384 != 688/387 = 16/9
Another common resolution is 1920/1200 = 8/5


But for some resolutions it's correct:



  • 1024/768 = 4/3

  • 800/600 = 4/3


Is there a technical reason / user experience reason for this? Why do displays have other ratios than what they get advertised?


(I assume that every pixel is a perfect square. Is this assumption wrong?)



Answer



Not every display resolution has to be 16:9 or 4:3.


My laptop and my TV have the well known 16:9 ratio.
My regular display has 16:10, at least they are marketed as 16:10, however the image below has them as 8:5. The broken screen that still sits on top of the locker behind me has a resolution of 5:4.


The image below shows most of the standard resolutions that are available.


source


I actually like 16:10 more than 16:9 and would pay a fair amount more money to get one of these instead. This however is personal opinion but should exemplary show you why there are not only two but a lot more standards to choose from.
Why do I like it so much? Not all movies are 16:9, there are a lot of 4:3 shows out.
When playing games I like it more to have a bit more vertical space to place menus, HUDs etc.
This of course comes down to personal preference. Personal preference between individuals is different and so are displays.


Why are displays marketed as 16:9 if they are not?
If this is done knowingly, I'd call that a scam.


windows command-line program to change the volume of an mp3 file


I can use audacity to increase the volume of an MP3 file. However, if I want to use this on a regular basis it's a hassle, since I have to fire up audacity, load the file, increase the volume and finally export it back to MP3.


Is there any command-line program I can use that will increase the volume?



Answer



mp3gain can do this:


http://mp3gain.sourceforge.net/


windows - Total number of files on an NTFS volume?


I am looking for a fast way of counting the total number of files - and directories - on any NTFS volume. (In an ad-hoc way. That is, given any random box, not a specially prepared volume.)


Note: This is not about files per directory, just the overall amount of files on the volume.


Currently, the only way I know is to open the root folder of a drive in Windows Explorer select all elements, right-click to choose Properties and then wait (and wait) until explorer has counted all elements.


Is there a better/faster way?



Answer



At the DOS prompt, type the following command:



  • dir \ /s /a /w


(The "/s" switch enables a recursive search on all sub-directories {with most Unix utilities this is usually the "-R" switch}, the "/a" switch counts all files regardless of Attributes, and the "/w" displays multiple entries on a single line so that the report will finish a little bit faster. Change "\" to the desired path you wish to begin from; for a different drive letter, such as drive D:, change it to "D:\" to search that drive.)


Once finished, you'll be returned the prompt, and then the last two lines of output will reveal a count of the total number of files and total number of directories. If you're looking for total number of filename entries, then just add those two number together, otherwise the total number of files is all you'll need.


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