Sunday, 30 June 2019

wireless networking - About 1/3 of web sites load really slow on my desktop connected to wifi, but not on my iPod Touch connected to the same wifi


I have a very puzzling problem I just can not figure out.


I have AT&T DSL, a package that supports "up to" 5mbps download speed. Using bandwidth tests online, I've typically seen about 4500kbps download speeds.


The majority of websites I visit come up quickly. I can stream Netflix and watch Youtube no problem. On the rare occasion that I've fired up Bittorrent, my downloads have been reasonably quick.


However, roughly one third of websites that I visit are EXTREMELY slow when visited on my PC. I'm talking 3-4 MINUTES to display a page, sometimes 10 minutes to download a 500KB file. Sometimes connections are apparently dropped/aborted, but not closed. Leading to file downloads or half loaded pages that are "loading" but never make any progress until I hit "stop" and try again. This problem include several banking sites like www.americanexpress.com and www.ingdirect.com, but not some other HTTPS sites like gmail or Amazon. Also extremely slow most of the time are www.teefury.com and www.gamepro.com, and some others I can't think of right now. The remaining 2/3rds of the internet loads at a decent speed.


However, every now and then, I'd say less than 10% of the time, those sites work at normal speed too. It's rare though, and it always comes in "phases". If a site is fast now, it will still be fast in 5 minutes. But I haven't been able to find any pattern in the times that it works properly.


This is a recent problem. For months after I set my computer up I had no issue. But this problem started maybe 6-8 weeks ago and has continued ever since.


I figured, it's got to be something wrong with my internet connection, right? But here's the weird thing - I can visit those exact same sites using my iPod Touch, connected to the same wifi access point and using the same password and settings, and the iPod has no problem loading them quickly. And yes, I made sure to visit the desktop versions of the sites, not the mobile versions. The problem seems to be specific to my PC.


Why is my PC loading only certain sites slowly (most of the time)?


Things I've already tried:



  • Rebooting

  • Examining my IP setup in windows for any obvious issues

  • Updating the drivers for my network card

  • Updating the firmware on my router

  • Examining my router's setup for issues

  • Scanning for spyware/malware. I didn't find any, and my computer is blazing fast and issue-free for absolutely everything except this one issue. I can cold-boot in like 10 seconds.

  • Changing my DNS. I'm using OpenDNS right now, but I tried reverting back to my ISP's DNS servers for several days to see if that would help. It didn't.

  • Clearing my browser cache

  • Clearing my DNS cache

  • Using a different browser. I normally browse in Chrome, but I tried Firefox to see if that would help. It didn't.


Vital stats:


OS: Windows 7 Professional 64-bit SP1


Network card: ENCORE ENUWI-N4 USB 2.0 Wireless Mini Adapter


PC: Intel Core i5, 4GB ram and a 120GB SSD system drive.


Software: Nothing unusual. Not running any special firewalls or security software, just what's built into Windows. Actually, it's a pretty lightweight setup since this is still a recently-bult computer.


Router: Linksys WRT54G, running Tomato firmware v1.28


Wifi network: 802.11g, Secured with WPA2 using very strong (and very long) password. Not shared with anyone.


I have no idea what else to do here. Any ideas?


Edit with additional test:


I have just found an old laptop I had, connected it to the wifi, and tried to load the same sites I was viewing on my PC side-by-side at the same time. A statement PDF from www.americanexpress.com downloaded in about 3 seconds on the laptop, whereas it took more than 2 minutes on the desktop. Again, they were using the same internet connection.



Answer



Turns out it was the drivers for the network card. Even though I'd installed the correct drivers and verified them, and they worked for a while, every time Windows update ran it would download install incorrect drivers that it thought were "better". Because they mostly worked I didn't notice the problem right away. I didn't notice the issue in Device Manager either when I went to verify and update my drivers manually, because the mis-identified device looks similar to the correct one.


I uninstalled the incorrect drivers and the problem went away, but Windows keeps trying to download the incorrect drivers whenever it updates, and the "correct" drivers have some oddities on Windows 7 anyway, so eventually I just bought a new network adapter. This solved the problem permanently.


Changing default link handler in Windows 7


I'm tying "http://google.com" into the Run prompt, click OK, and nothing happens. How do I edit the default program that handles links?


I'm using Chrome, and when I browse at its settings it is marked as the default program to handle links. Should I reinstall Chrome to fix this?



Answer



Have you tried Windows 7's own settings?


If you go to start there should be an option for Standard programs (below Configuration screen), there you can set Chrome to your default browser. Worked for me.


Check this link for more information


alt text


Batch file rename with suffix as 01 02 03 04 and so on

I have bunch of files with similar keyword like


computer-stock-photo.jpg 
computer-stock-picture.jpg
computer-picture.jpg

What I want to do is suffix serial wise 2 digit numbers like


computer-stock-photo-01.jpg, 
computer-stock-picture-02.jpg,
computer-picture-03.jpg

Also, the batch script should work with any extension like jpg or png.


The script I tried:


@echo off
setlocal disableDelayedExpansion
set "chars=0123456789"
for /f "eol=: delims=" %%F in ('dir /b /a-d *.jpg') do call :renameFile "%%F"
exit /b

:renameFile
setlocal enableDelayedExpansion
:retry
set "name="
for /l %%N in (1 1 8) do (
set /a I=!random!%%36
for %%I in (!I!) do set "name=!name!!chars:~%%I,1!"
)
echo if exist !name!.jpg goto :retry
endlocal & ren %1 %name%.jpg

The above script only work for jpg and add random numbers not serial wise.

Mirror column on separate sheet in Excel 2010

I am trying to mirror a column from one excel sheet to another within the same excel book. The goal is to have the second sheet update as the first sheet is edited. Basically, as I add/remove rows in the first sheet, it will do the same automatically in the second sheet.


My column has employee names, and as people move in/out of the office I will be adding/removing them accordingly. My sheets track different data, but the employees are all the same. My first sheet is the primary sheet and the rest pull data accordingly. Would a mirroring formula work? Also, how do you get it to apply to the entire column?

linux - Binding Super+C Super+V to Copy and Paste


For some time I've been interested in binding the Windows Key (Super_L) on my keyboard to Copy and Paste for no other reason but convenience and consistency between my desktop and my MacBook.


I thought that I was close after reading about xmodmap and executing the following:


$ # re-map Super_L to Mode_switch, the 3rd col in keymap table `xmodmap -pke`
$ xmodmap -e "keycode 133 = Mode_switch"

$ # map Mode_switch+c to copy
$ xmodmap -e "keycode 54 = c C XF86_Copy C"

$ # map Mode_switch+v to paste
$ xmodmap -e "keycode 55 = v V XF86_Paste V"

Unfortunately, XF86Copy and XF86Paste don't seem to work, at all. They are listed in /usr/include/X11/XF86keysym.h and xev shows that the key sequence is being interpreted by X as XF86Paste and XF86Copy, do these symbols actually work? Do they have to have application level support?



Answer




What about binding your left Windows/Logo/Super key to act as another Ctrl key?


You can achieve that with the following xmodmap commands:


remove mod4 = Super_L
keysym Super_L = Control_L
add Control = Control_L

Assuming you saved the above lines as super_as_ctrl.xmodmap you can test out the effect by executing


xmodmap super_as_ctrl.xmodmap

To make the change permanent (surviving re-login/reboot) rename the file to .Xmodmap in your home folder.


(The above was tested on Ubuntu 11.10 live system, but it should be the same for other Linux distributions)





Having bound Super to Ctrl you can now use Super-C to copy almost everywhere. The only common exception is your terminal program. However you can redefine the shortcuts there.


I found out that even gnome-terminal has this option by now (I did not have until I got used to Ctrl-Shift-C anyway). In case you use that one, go to Edit / Keyboard Shortcuts... in the menu and assign Ctrl-C to copy and Ctrl-V to paste. Should be similar for konsole etc.


And don't worry, you won't loose the ability to terminate a program using a shortcut. After rebinding the copy shortcut for the terminal, you can just use Ctrl-Shift-C like you used Ctrl-C before. The terminal does not distinguish here if Shift is pressed or not. And the shortcut is not caught anymore for the copy. Alternatively rebind the terminate to another shortcut, as MountainX suggests in his answer.





Concerning the key symbols for copy and paste: Apparently they have no effect. I tested it quickly by assigning the copy action to Shift-ScrollLock (it was unused and I wanted to test with a non modifier key):


xmodmap -e 'keycode 78 = Scroll_Lock XF86Copy Scroll_Lock'

Pressing it had no effect, neither with XF86AudioMute. However it did work when assigning the letter 'a'. So I guess there is a specific problem with these XF86 special key symbols.


How to disable EMACS - Prelude colors? (terminal)

I've used PRELUDE to work better in terminal, but I'd love to work with my default Terminal theme(colors).


Zenburn-theme comes default with Prelude but It just work great the first time i run emacs with prelude recently installed. The next times, prelude makes a dark background in the currently working line. It is not cool.


I've used M-x disable-themes but I don't get my terminal colors either. Now the working line has a fluorecent green background. Not confortable at all.


How can I run prelude and keep my system terminal colors?


Thanks in advance.

partitioning - How to make a drive partition and install Windows on it from an HP install disc


I bought a new HP DV6-S190SE, and I want to make multiple partitions on the hard drive.


I went to HP's site and discussed with them using online chat. They said that this is not useful to make more than one partition, as when you recover your windows after some time it will erase/delete all files including new partitions, so this would not be very usefull for you.


Now, if there is there any way to get rid of the existing structure and install Windows only on the C drive? First of all, how do I partition the harddrive?



Answer



HP does not provide a conventional Windows install disc, only customized HP recovery media, which cannot be used in the same manner a regular Windows install disc can.


See this page for partitioning instructions on a HP notebook. HP notebooks have 4 primary partitions, so you have to do a few things before you attempt shrinking the C partition to make space for another partition, read carefully.


.


HP Recovery has a feature called "Minimized Image Recovery", it will recover the C: partition only, it will not touch any other partitions, but will wipe the C partition during the process, so back up personal data. If you ever need to recover the W7 operating system after creating another partition you will be able to, without disturbing the other partitions.


enter image description here


.


Make your recovery discs Now, use high quality DVD+R discs or a large usb drive. You can use these to recover if the recovery partition on the hard drive becomes unusable for any reason.


http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&docname=c01867124


.


EDIT:


Another option is to make your HP recovery media, then test it to be sure it boots and loads HP recovery manager, then cancel the recovery. Once this is done you can delete/reformat the D: (Recovery) partition to gain a partition to use, you may have to move some free space from C: to D: to get the size you want, I would use a 3rd party partition tool to move free space to D:.


.


graphics card - Windows 7 Crashes using nVidia Driver, works fine in Safe Mode or without video driver


Until this morning, and for over a year, my computer worked fine. I have an nVidia GTX 465 card running Windows 7 SP-1. Today, after running about thirty seconds, the screen freezes and I have to reboot. The first time this happened, I received a message along the lines "Windows recovered from a video driver crash".



  • The computer works fine in Safe Mode.

  • If I uninstall the drivers, it works fine in normal mode.

  • If I reinstall the drivers (fresh copies from NVidia), it crashes after running for a few seconds.


Prior to the last crash, the last message in my Windows System log is


Driver Management concluded the process to install driver 
FileRepository\monitor.inf_amd64_neutral_ab477c4d805d044f\monitor.inf for Device
Instance ID DISPLAY\HYO049B\5&E3CA944&1&UID3146000 with the following status: 0x0.

Any suggestions as to how to fix?



Answer



SOLUTION:


The GTX-465 card was indeed bad. Anything more precise than "bad" in our economy of disposable products would be impossible to determine. Removing said card from the computer solved the problem.


browser cache - Firefox says "server not found" because it's adding WWW. How do I stop this?


This is very frustrating.


I have been accessing servername.local on Firefox. That's its URL. No www.


At some time, servername.local ceased to be available and I got an error message: "Server not found". Fair enough.


However, Firefox didn't just try servername.local, it tried www.servername.local as well. "Server not found" again.


The problem is, now that servername.local is back up and running (I can get to it with other browsers and by IP address), Firefox always tries for www.servername.local, no matter if I type in the correct non-WWW URL or use a bookmark.


I cleared the cache, I cleared the history. No change. I flushed the DNS cache, that didn't help either.


Any suggestions?



Answer



Firefox is utilizing Domain guessing. It is an option that will automatically insert www or .com so that you don’t have to.


But, you don’t want that www., and there is a way to shut it off. The option to shut off domain guessing also requires shutting off keyword search for the changes to take place.


Changing Keyword search:



  1. Type about:config in the location bar and hit enter. You will get a message, "This might void your warranty" pop up. Click the “I’ll be careful, I promise.” button.


aboutconfig



  1. Type Keyword.enabled in the search field and double click the keyword.enabled preference to set the value to false.


aboutconfig1


That is the Keyword Search part taken care of. Now to shutting off domain guessing.


In the search field, type fixup and double click on browser.fixup.alternate.enabled so that it will go to false.


All done, no more WWW or .com.


fixup


More to be learnerd here: Mozilla Support


firefox - How can I copy text from a web page where it been has disabled?


I use FF27 with noscript, but solutions for Chrome are also welcome.


I use online chat for customer support when available, and I'd like to keep the chat transcript in case of a dispute with the provider. My credit card provider has such a chat interface, but has disabled copying the text - using javascript I assume (is there another way?). I have no knowledge of JS, but I notice that when I select text, the selection vanishes at the next event (such as click or after some time), I could find no way to bring up the context menu and ctrl-c has no effect. I'd like to circumvent that with minimal impact on other pages. I'd rather not install extensions.


FF used to have an option in the settings UI to disable certain javascript features, but it was removed. I've found about:config settings that disable JS overriding the context menu, and disable clipboard events - but both of those are global and the former will probably mess sites like Google Docs too much for my taste. I haven't looked at what Chrome has to offer in terms of non-UI settings. I couldn't find any fine-grained JS control on NoScript, but I assume it's possible to filter out the JS code that disables copying text.



Answer



In Chrome or any of the popular modern browsers, open Developer Tools by clicking F12 and then click on the magnifying glass icon (or equivalent icon in other browsers) to turn on inspect mode. Move to the content within the web page and point to the specific portion of text that you want to copy. The HTML code corresponding to the pointed area will appear in the docked Dev Tools window. Double click on the HTML code to copy the content you need.


Alternatively, you can save the page as a text file in Internet Explorer and then you can get just the text within the web page in the text file. In IE, choose File > Save As and in the dialog box that opens up, specify the Save as type as Text file.


windows 10 - Duplicate Folders in "This PC" but no names


I got this issue where I have duplicate 'Downloads','Music','Videos','Pictures', and 'Documents' folders. The weird thing is that the other folders don't have names but they have the same icons. They are causing some applications like Windows 10 Recorder in Xbox application to not work.


Duplicate folders:


enter image description here


Xbox DVR recorder issue:


enter image description here


I tried to find the registry folders for them but no good :/ ... does any one have any idea on how to fix this



Answer



This is due to missing subkeys under the "FolderDescriptions" registry key, or the entire key gone missing as you've found already. See [Fix] Cannot Rename or Move Folders in Windows 10, Due to Missing FolderDescriptions Registry Entries


That page contains the registry export of this entire branch:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions

Run it (ignore error when importing, it's normal, as 3 branches can't be written to.) and restart Windows.


linux - How to open port via SSH tunnel?


There is a system B with the following open servers: I have a web server listening on port 80 and a ssh server listening on 22. However, only port 22 is publicly available. Now, I would like to create some kind of tunnel, so that I can access B:80 from A. However, my client computer A that would like to connect to the system B is not publicly open, either.


So, all I have is a client computer A from where I would like to access the server B and, there, an open port 22. On A, no port is open or can be opened.


What (I think) I would need is to open locally (on A) some port that connects in some way through port 22 of B to port 80 on B.


Is this possibly without using any man-in-the-middle open servers with multiple ports?



Answer



(Note: Jakuje answered while I was composing my answer. It's more elaborate from the start, so I'm posting it anyway.)




If I get you right, all you need is to forward a local port through SSH. I assume you have SSH access to B.


Linux command to run on A:


ssh -NL 2345:127.0.0.1:80 B

Now you can connect to the port 2345 on A and it should be equivalent to connecting to the 80 port on B from the B itself.


Few remarks:



  • -N causes ssh not to execute a command on the remote (B) side; perfect for port forwarding.

  • The number 2345 is arbitrarily chosen; it may be any number from 1024 to 65535 (binding to a port lower than 1024 requires root access usually). If you happen to hit the already occupied port, then try another number.

  • The 127.0.0.1 address I used requires your web server on B to listen on the loopback interface. If it listens on some other address(es) only, use it instead. This address should be a valid address of your server as seen from within the system B. It doesn't matter at all what this address means to A nor if it means something in the first place.

  • If you need computer C to connect to the 2345 forwarded port on A then you should get familiar with ssh -g option. Read man ssh.


How do I manage multiple audio playback devices on Windows Vista/7?


I've got speakers (audio in) and headphones (USB headset with it's own soundcard) connected to my desktop computer. Under Windows 7, I can right-click the Audio Mixer and select Playback Devices and toggle between my these devices.


Is there an easier way, perhaps a keyboard shortcut, that would make it easier to toggle? I'm working in an shared space were sometimes I want headphones to avoid annoying other people, but at other times speakers are OK. I want to be able to toggle quickly. In an ideal world, the solution to my question would work in Vista too.



Answer



The solution to all your nagging Windows automation problems: AutoIt!


Put this AutoIt and compile it


;-----Configuration-----
;The title of the sound config window.
Dim $ConfigWindowTitle = "Sound"
;-----End of configuration----

Dim $ItemNumber = 1
If $CmdLine[0] >= 1 Then ;If we have a parameter...
$ItemNumber = $CmdLine[1] ;...we should press the button the specified number of times.
EndIf

Run("control mmsys.cpl") ;Run the sound control applet and hide it.

WinWaitActive($ConfigWindowTitle) ;Wait for it to be active before sending keystrokes.

Send("{TAB}{TAB}{TAB}{TAB}") ;Put the focus on the list

For $i = 1 to $ItemNumber Step 1
Send("{DOWN}")
Next

Send("!s") ;Press Alt + S to set the selected device as the default.
WinClose($ConfigWindowTitle)

Now create a shortcut, and in the Target put the path to the compiled executable. For an argument, put the number of the sound device in the list that you want to switch to. (to switch to the top item in the list, put 1, the second item in the list, put 2, etc). If you want a keyboard shortcut, use the Shortcut Key field in the shortcut's properties window.


I'd been looking for something to do what you wanted to do, and found that there's no programmatic way that you can switch audio devices in Vista/7. It's just not something that Microsoft decided that programmers need to do, so I make this script to automate the process. It's not the best since it pops up the window in order to change the device (necessary), but it makes it possible to create shortcuts to change the output device for your sound.


windows - What's the difference between a "Keyboard Language" and an "Input Language"?


I see the same keyboard options underneath different languages, and it's confusing me...


What exactly is the difference between selecting an "input language" inside Windows, versus merely selecting the "keyboard layout"?


Screenshot



Answer



Language includes things like is it right to left, or left to right, and the keyboard layout is just "when you press A, you get a" and things like that.


hard drive - How to extract current chrome browsing session from HDD of a broken laptop?


The HDD is OK. I am accessing it via SATA-USB cable on a different computer.


I have extracted all data before I will send it to repair but I had some important tabs open and I would like to find my current browsing session.


Where is that stored?



Answer



It's stored in Chrome's profile. The profile resides in:


C:\Users\\AppData\Local\Google\Chrome\User Data

You can copy this entire folder and restore it on another PC to the same location (username can differ).


You can get permission issues while copying because the old profile is owned by another user. You can change owner and permissions in folder's properties. (This won't be an issue if you'll be moving the profile with an intermediate FAT32-formatted media, such as most flash drives.)


but...


If you were signed in to Chrome, there's a chance that your tabs were synced to Google's servers. Go to History (Ctrl+H) and click Tabs from other devices on the left. If you had your tabs synced to the same Google account that you're currently signed into, you'll see your tabs.


microsoft excel - How to make a Pie radar chart


I want to create a circular chart in Excel with 8 sectors like in this example:


enter image description here


Instead of representing the percentage like in a pie chart, I want the actual value like in a radar chart.


Is it possible without using macros?



Answer



This walkthrough is based on Andy Pope's original tutorial here. Let's say this is the data you're starting with. There's a bit of data manipulation to do before we create the chart.


values


In your example we want all the sectors to be the same size, but let's make things flexible and add in a sector weight column. eg if you wanted 'WORK' to appear as a double/triple/quadruple-sized slice, just change the sector weight to 2/3/4 etc.


sector weights


Now we need to calculate the slice proportions that each sector needs to cover. Add a column called '% of 360', dividing the sector weight by the sum of all sector weights.


=C2/SUM($C$2:$C$9)  

Next we need to calculate the start and end angles that each sector covers. Add a 'Start Angle' column. In the top row enter 0, then for each row below reference the cell above.


In a 'Finish Angle' column multiply the cumulutive figure for '% of 360' by 360.


Start/Finish Angles


Now the trick to making a radar chart think it's a pie chart is to create data points for every one of the 360 degrees in a circle.


Let's extend our table, with a column for each angle (shaded grey in my example). For each cell, add some logic that checks whether the angle for that column is covered by the Start/Final Angles - and if so return the value for that row. Make sure you copy this for all rows and columns for 0-360 degrees.


=IF(AND(G$1>=$E2,G$1<=$F2),$B2,0)

enter image description here


(Note - If you're using Excel 2003 or earlier you will need to flip this table round so the table is vertical (transpose) because the number of columns used by this method is greater than the number allowed by old versions of Excel.)


We can now think about the chart. For flexibility's sake let's add a "Chart Labels" column between the final Angle and the 0-360 degrees. I'm just going to refer to the titles in column A but you might want to customise them here.


chart labels


Select all cells under the "Chart Labels" and 0-360 columns (G2:ND9 in this example). Insert a chart - under the radar chart options choose the end one - "Filled Radar". You'll get this.


enter image description here


Delete the legend and the circular data labels (highlighted yellow). Right-click the remaining axis and choose Format Axis. Set the major unit fixed to 10 (your maximum value) and the minor unit fixed to 1. Close the dialog box, then delete the axis numbers on the chart.


Switch on Major & Minor Horizontal Gridlines:


circular gridlines


Now our chart looks like this.


enter image description here


Set the major gridline line weight to be 2pt and black for the outer circle border. If you want to make the segments show the minor gridlines you will need to alter each segment's fill colour and set transparency (about 20-40% transparent should do it).


enter image description here


To get the radial segment borders we need to add a new series. Set the title to be cell C1 ("Sector Weight") and the values to the rows in column C (C2:C9). Set the horizontal category axis labels to be your chart labels (G2:G9).


Change the chart type for this new series to a pie chart. Remove the fill for the pie segments and add black borders. Add data labels for the pie series, selecting the Category Name instead of Value and setting the position to Outside End.


enter image description here


EDIT (Sep 30 2014): The workbook is available for download here as requested by Firee.


EDIT 2 (Mar 25 2015): Mihajlo has pointed out that this technique can be improved slightly:



The graph ends up with a slight shift counterclockwise (as seen on the last graph above with red having a gap at the vertical, but covering the boundary at 300 degrees). This is due to spider chart always being one behind (i.e. 1 degree is plotted at 2, 2 at 3 and so on),


A quick fix to this is to change the formula for finish angle (F2) from =360*SUM($D$2:D2) to =360*SUM($D$2:D2)+1 and change the formula for the first point of the last series to be the same as the last point of the last series (in the above example make cell H9 formula to be =ND9.



Saturday, 29 June 2019

adobe photoshop - Converting grayscale shades into alpha channel


I have a gray-scale image. I need to convert gray-scale tones to transparency data in alpha channel using Adobe Photoshop. Say if the area is black, then no transparency. The white areas will be converted to full transparent pixels in alpha channel.


How to do it?


Update:


This is sample file, which I made by Fireworks. This sample is a result which I would like to achieve in Photoshop.


Sample


If you open this PNG in Photoshop, you will see what I mean.



Answer



Create a totally black layer (raster or vector). Then...


Layer > Add Layer Mask

Will add a totally white mask to your layer. This will be the alpha channel. When you watch channels (by clicking the Channels tab next to Layers) you will see this alpha channel as


Layer 0 Mask

Now you can copy-paste the grayscale image (or any channel) to this and there you have it. Use CTRL + I to invert it.


networking - Allow PowerShell remote access only from one address


I must manage a school network of about 60 Windows computers that are setup as workgroup computers and not in a domain. To ease configuration I am going to enable PowerShell remoting on all computers. (I know about Enable-PSRemoting and how to set this up in general) To limit security risks as far as possible, remoting to these computers should only be possible from my administration PC with a certain IP address.


So consider this example:


Computer 1: only accepts remoting connection from admin, not from computer 2
Computer 2: only accepts remoting connection from admin, not from computer 1
Admin computer: can remote on all computers

I'm not sure how to set up the Windows firewall on the computers to allow traffic of the WinRM protocol only from one IP address. The whole network is set to 'private'.


Can somebody help me out with enabling the correct firewall rules?



Answer



Like explained in this article: Enabling PowerShell remoting for only a specified set of IP addresses.


(for each client pc1/pc2/pc...) you have to:


enable-psremoting

next: remove the winrm-listener that was created by enable-psremoting


Remove-WSManInstance winrm/config/Listener -SelectorSet @{Address="*";Transport="http"}

now the machine listens to nobody, so you have to create a new listener for the admin-client


New-WSManInstance winrm/config/Listener -SelectorSet @{Address="IP:10.11.12.13";Transport="http"}

now restart the winrm service


spsv winrm -pass | sasv -pass |gsv   #*

(you have to run PowerShell as admin)


\*
*spsv = stop-service // sasv = start-service // gsv = get-service // -pass = -passThrough*

networking - Specific static IP settings on different WiFi


I've been trying to set a static IP address for myself. My router details are as following:


Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::4c77:ef95:76:961b%13
IPv4 Address. . . . . . . . . . . : 192.168.1.16
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

I set the static IP address to 192.168.1.50. However, since I go to school and connect to my own access point I set up there, the IP it gives me is 172.168.1.2 (without a static IP). My question is, can I configure my Wifi adapter to set a static IP address only if I'm connected to my home network?



Answer



I am assuming you're on Windows. If not then please correct. If you go into:


Network and Sharing Centre > Right click Wireless adapter > Properties > Select IPv4 > Properties.


In there configure your primary network settings under the general tab (probably obtain IP automatically) and under Alternative specify the information related to your other network.


Hope this helps


EDIT: So using alternative IP. Generally speaking you would configure your alternative configuration to specify settings when a DHCP server is not present (and cannot collect an IP automatically). If this is the case for you then set the primary to collect an IP automatically (for your school network) and assign manual configuration to alternative when at home.


If, however, this doesn't work you can probably assign both networks manually, but this would depend how your school network runs. I assume you won't be able to specify a manual connection if there are several hundred systems on the network. Be aware though, as pointed out below, once you start specifying static network configurations you won't be able to use your system anywhere else without resetting the network.


Can a GPO be exported from one server and imported into another?


I have a W2008R2 server where we have a default GPO setup. I like the setup and do not want to recreate it for our new W2012 server.


I did export it from 2008 but the only option I can find to import in 2012 GPM is manage backups. I add the directory where it was backed up to and it doesn't find anything.


Can I export/import to the new server? If so, how?



Answer



You have to first create a new GPO in the target domain that you want to import the settings into, then right-click it and choose Restore from Backup...


Another alternative is to connect your Group Policy Management Console to both domains, and then you can copy and paste GPOs between domains; just watch out for ownership of the GPOs after doing so.


The bonus to doing it that way is that will also copy scripts associated to the policy object (if the script is stored directly in the policy's folder).



we have a default GPO setup. I like the setup and do not want to recreate it



PS: if your talking specifically about the "Default Group Policy" object, then you are doing things wrong (and now is the perfect time to start doing them right).


You really shouldn't be modifying the "Default Group Policy" object. Instead, add other GPOs to override its defined policies as necessary.


That way if you need to revert a policy to the default setting as it was out of box, you can just disable/delete the other GPOs instead of running around trying to figure out what the "Defaults" originally were. It also allows you to easily separate your polices into GPOs based on what they are for, so they can be applied granularly, and as needed, to various OUs.


Windows XP Generic Text Driver and Printer Name Bug


I am using a Windows XP machine and I'm printing to a Zebra Printer using the "Generic / Text Only" driver.


I have a printer setup, in the Windows, Printers and Faxes area. It is called "Generic / Text Only", and is driven by the generic text driver. All the settings are set to default, except for the port. I have it set to a Standard TCP/IP Port with the IP of the printer.


I'm able to ping and print to the printer just fine. Unless, I change the name of the printer in anyway. If I change the name and then try to print, the formatting gets thrown off. It will either insert random blank spaces within the text or only prints within a 1 inch area. Printing characters over top of each other.


I have 3 different Zebra printers I would like to setup on my PC and have each named accordingly for ease of selection. Instead of having to go in and updated the IP each time. I even tried setting up a new printer and just using the default name supplied by the Print Wizard, "Generic / Text only (Copy 1)", and I still got the incorrect format.


Has this been seen by anyone else? Is it a driver bug that has been resolved and can be fixed with an update? Any suggestions?



Answer



The generic text driver adds line feeds and other control characters into the stream. OTisler has the right idea to use the Zebra driver. Use that driver with the WritePrinter API. That API will send the data unchanged to the printer.


laptop - Why does my Acer aspire make a clicking sound when switched on?

I get a continuous clicking sound from my Acer Aspire One when I turn it on, along with a blank black screen. Can anyone help please.

On PCIe 1.0, does a 64 bits graphic card could be compatible with 32 bits OS (Windows 7 32bits)


On PCIe 1.0, does 64 bits graphic card could be compatible with 32 bits OS (Windows 7 32 bits) ?


Is there any restriction?


Edit:



Few peoples told in comments that bitness should not be an issue. If I understand well, it is only a question of is there any supported drivers for the specific OS (here Win 7 32 bits) ???



Edit2: I finally bought a 64bits graphic card with PCIe 1.0 interface and it work nicely on my Windows 7 32 bits... Thanks to all !!!



Answer



The bit width of the bus (PCI, PCI-X, AGP, PCIe, etc) has nothing to do with the processor word size. It is simply the number of bits the communication channel can carry at a time.


The southbridge (now part of the Intel PCH or AMD chipset) handles the communication between the CPU and expansion cards (including video cards), so the bit width of the bus does not create any restrictions on the processor architecture.


Ultimately, whether your system can use the cards attached to your computer's expansion slots comes down to whether appropriate drivers are available.


freeze - Hung process in Windows: Is there any way to see why?

I tried to print a doc in word, and word froze. Is there any way for me to see what resource it's waiting for?


I'm using windows XP and word 2007 (though I imagine the answer doesn't depend on the process that froze)

Can router connect back to itself over Internet and why?


As it it sates in title.


Every router I had couldn't connect back to itself over Internet, for example:



  1. I open forward port 22 for ssh on my PC.

  2. I try to connect to that ssh with other PC in same network, with ssh user@my.public.ip but I get refused by router

  3. I can connect from other network (other public IP) just fine, with same ssh user@my.public.ip


Is that just my bad luck with routers or there is something behind it?


Thanks



Answer



You'll need a router that supports loop back functionality.



Many DSL routers/modems prevent loopback connections as a security feature. This means that a machine on your local network (e.g. behind your DSL router/modem) cannot connect to a forward facing IP address (such as 199.149.252.44) of a machine that it also on your local network. Connecting to the local IP address (such as 192.168.2.40) of that same machine works fine.



Source: http://opensimulator.org/wiki/NAT_Loopback_Routers


This thread over at sec discusses security implications (or lack thereof): https://security.stackexchange.com/questions/16343/is-nat-loopback-on-my-router-a-security-problem


laptop - Is my Ubuntu install 32 or 64-bit?


I'm trying to find out if my Ubuntu install is 32 or 64-bit. The best I can find is "i686" does this mean its 32 bit?


What's the correct way of finding out if the Ubuntu installed on my laptop is 32 or 64-bit?



Answer



Go into the terminal and type in.


uname -a

If your results are similar to the one below, then yours is 64-bit; otherwise, it is 32-bit.


Linux ubuntu-tm 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011 x86_64 GNU/Linux

If you have the x86_64 then your machine is 64-bit.


If your results are similar to this one; then you have 32-bit.


Linux Server 2.6.15-23-386 #1 SMP Tue Mar 1 13:49:40 UTC 2011 i686 GNU/Linux

Notice the i686 in the code, that means your machine is 32-bit.


UPDATE:


Type in the following in the terminal;


uname -m

It will give you either x86_64, which is 64-bit, or something else, which is 32-bit.


Keyboard selective ghosting


I've been experiencing a problem with my keyboards lately. I own an Alienware laptop M11x. I've attached a USB Trust keyboard first and experienced some problems while playing FIFA 12. Namely: When the Left and Up buttons are pressed I cannot press one of the buttons S, G, B, N, H. S is very important since it's my pass button.


So I took the keyboard back and bought a Microsoft Keyboard 600. Alas, the problem still persists. I must say that for instance I can press 4 buttons like: A S D F and it will work like a charm.


Update: I must say that that particular problematic combination works on my laptop keyboard and it persists over the whole system.


Cheers



Answer



It's call n-key rollover. It controls the total number of keys that can be pressed at one time on a keyboard before the controller stops recording new keypresses.


Usually, you'll only find full n-key rollover on high end keyboards. Normal or low-end keyboards will generally have a limit after which the keyboard controller will stop recording. As your key sequence is 8 keys long, you're probably well over the limit.


Wikipedia has an article with a few more details: http://en.wikipedia.org/wiki/Rollover_%28key%29#n-key_rollover


If you really, really need a key combination this long for your kick move you'll need to try a keyboard that specifies full n-key rollover as a feature to ensure that the keyboard will always be able to handle every key you press all the time.


macos - Get mac tar to stop putting ._* filenames in tar archives




Possible Duplicate:
Why do I get files like ._foo in my tarball on OS X?



I create autoconf scripts on a Mac. When tar runs, it puts all of these ._foobar names in the archive:


libewf-20110312/borlandc/builder5/ewfacquire/._ewfacquire.bpf
libewf-20110312/borlandc/builder5/ewfacquire/ewfacquire.bpf
libewf-20110312/borlandc/builder5/ewfacquire/._ewfacquire.bpr
libewf-20110312/borlandc/builder5/ewfacquire/ewfacquire.bpr

Now what's going on is the Apple's HFS filesystem is putting the file properties in the ._foobar names so that they can be restored on another Mac system. But I don't want them --- they are just junk for me. Is there any way to suppress them?



Answer



Per an answer to another question, you can set the undocumented(?) environment variable COPYFILE_DISABLE to prevent several of the system-supplied programs (including tar) from giving special meaning to ._* archive members. In particular, it will prevent them from:




  • storing extended attribute data (including resource forks) in ._* archive members
    (i.e. do not “pollute” archives created on Mac OS X but meant for use on other systems), and




  • attempting to extract extended attributes or resources from archive members named like ._*
    (i.e. do not misinterpret ._* archive members in archives from other systems).




The value you use for the environment variable is not important (it can even be the empty string). Values like 0, and false will not reenable the feature. The only thing that matters is whether the variable is set (you have to “unset” it to reenable the feature).


You can use this variable on individual commands by taking advantage of the ability of Bourne-style shells (sh, ksh, bash, zsh, etc.) to prefix commands with extra environment variables.


COPYFILE_DISABLE=1 tar cf new.tar …

If you run into the problem more often than not, then you might want to set and export this variable in one of your shell’s initialization files.


# turn off special handling of ._* files in tar, etc.
COPYFILE_DISABLE=1; export COPYFILE_DISABLE

When you need to, you can then unset the variable for individual commands.


(unset COPYFILE_DISABLE; tar cf somefile.tar …)

On this Mac OS X 10.6 system, the following commands all seem to know about COPYFILE_DISABLE:



  • /usr/bin/tar (a symbolic link to bsdtar)

  • /usr/bin/bsdtar

  • /usr/bin/gnutar

  • /bin/pax




COPYFILE_DISABLE originated in Mac OS X 10.5. If you need to support 10.4, it has COPY_EXTENDED_ATTRIBUTES_DISABLE that works in the same way.


windows 8.1 - Black screen after boot

Yesterday Windows installed some updates when shutting down. Today I wanted to start Windows, but after the BIOS screen I only see a black screen, with no cursor or whatsoever. I search for this issue and found out, that it might have something to do with a corrupt display driver. But this does not help my much because I can't enter the safe mode of Windows (hitting the F8 key has no effect). I also tried to recover from an old recovery point using the Windows 8.1 installation DVD, but I get a message that no recovery points were found even though I'm pretty sure I have some. What can I do at this point? Is re-installing Windows my only option?


Edit: I also tried to open up the task manager with Ctrl+Shift+Esc, but it also doesn't show up. I only get a message from my monitor "Suggested Resolution: 1920x1080px". I also saw yesterday a second before the shutdown an error message, but I wasn't able to read it.

tmux vs. screen


I'm about to get back into using GNU Screen, but I have been hearing people occasionally mention tmux as a better alternative. Does it really offer an alternative to all the features Screen offers, such as activity monitoring in different windows, etc.? What are the pros and cons of each?



Answer



Some of the (major) reasons I prefer tmux over screen:



  • Status bar is much easier to use. You can easily set up different text/styles for current window, windows with activity, etc. and you can put things on the left and right of the status bar, including shell commands that can be run at a specified interval (default 15s).

  • Almost any command you can run inside tmux can be run from a shell with tmux command [args]. This makes it very easily scriptable, as well as making it easy to do complex commands.

  • Much more accurate automatic window renaming. While screen sets the title based on the first word of the command, and requires shell configuration to do even that in a shell window, tmux keeps track of what processes are actually running in each window, and updates the title accordingly. This way you get dynamic renaming with any shell and zero configuration. For example: Let's say you're running Z Shell; the window's name would be "zsh". Now let's say you want to edit some configuration file, so you type sudo emacs /etc/somefile. While sudo is asking for your password, the window's name will be "sudo", but once you've done that and sudo launches emacs, the title will be "emacs". When you're all done and you exit emacs, the title will change back to "zsh". This is pretty useful for keeping track of windows, and it can also be especially useful in specific situations, like if you have some long-running process in another window that occasionally prompts you for input using dialog; the window name would change to "dialog" when that happened, so you would know you had to switch to that window and do something.

  • Nicer session handling (IMHO). You can do a lot more with sessions within tmux itself. You can easily switch, rename, etc. and you can move and share windows between sessions. It also has a different model, where each user has a server which controls his/her sessions and which the client connects to. The downside of this is that if the server crashes, you lose everything; I've never had the server crash on me, though.

  • tmux seems to be more actively developed. There are updates pretty frequently, and you can file a bug report or feature request according to this FAQ and get an answer within a few days.


Those are only the major things that immediately come to mind. There are other little things, too, and I'm sure I'm forgetting some things. It's definitely worth it to give tmux a try, though.


Where can I get information on the mechanics of fonts?


Following my line of "simple" questions: where can I find information about how fonts are made/rendered, and details like what hinting is?


Edit: I'd like more details about font rendering.



Answer



There is an open source font creation app fontforge, that has a very helpful help page describing many of the fundamentals of font construction:


http://fontforge.sourceforge.net/overview.html#TOC


and hinting specifically is here:


hinting


http://fontforge.sourceforge.net/hinting.html


Some more font building & hinting resources: iLT how to make a font part II — ❧ —Truetype Hinting — ❧ — Adobe opntype font development kitAdobe opentype hinting information — ❧ —Hinting tutorial from the DejaVu designers


Rendering Articles: How does sub-pixel rendering work? — ❧ — Font smoothing, anti-aliasing, and sub-pixel rendering


And just for fun:


alt text


{source}


Friday, 28 June 2019

streaming - How to play .qtch files?

So I have qtch files that apparently were created with QT 7+ because they can't be played (with QT 7+ or VLC) just by renaming their extension (as fileinfo.com says).


Any solution out there ?

windows 7 - Is it better to add a second video card in Crossfire or replace an aging video card?


I am using Windows Media Center and have come across the ridiculousness that is DRM (ala can't play DVD/Blu Ray from computer through Xbox 360 extender onto the tv).


I am looking to do something about this by upgrading my video card so that the computer will be directly hooked up to the TV over HDMI.


My PCI slot setup is:




  • PCI Express 2.0 x16 - 1 x PCI Express x16 slot, running at x16 (PCIEX16)




  • PCI Express x16 - 1 x PCI Express x16 slot, running at x4 (PCIEX4_X1)*




  • When the PCIEX1_2 slot is populated with an expansion card, the PCIEX4_X1 slot will operate at up to x1 mode.




I need to have both monitors connected while HDTV is connected as well.


I am considering two options:



  1. Add a second video card running in Crossfire that would be used for the HDTV

  2. Replace my existing video card with a new single card with three outputs (2 DVI & 1 HDMI)


Would it be better (no bugginess) to add a second video card to to my system in Crossfire or would it be better to scrap the card and replace it with a whole new card?


My computer setup is:



  • Win7 Home Premium x64

  • Gigabyte GA-P55-USB3 LGA 1156 (with Crossfire support)

  • Core i7-860

  • 4 GB DDR3

  • XFX HD-465X-ZDF2 Radeon HD 4650 1GB 128-bit DDR2 PCI Express 2.0 x16 (Dual DVI output)

  • Dual DVI (non-HDCP) monitor setup



Answer



First of all it depends on your budget. :) You could use Crossfire only if you want to upgrade your performance (by 1.5x to 2x). However, if you want to support 3 or more displays properly, you need at least the Radeon 5xxx series.


There are several Radeon 5xxx or 6xxx which not only give you significantly better performance, but also as many as 6 display outputs without having to go Crossfire.


That said, the upgraded single approach would be my recommendation because:



  • You need a 5xxx series or better to support multiple displays

  • Newer single cards have 3-6 or more connectors

  • Single card gives significantly better performance AND features

  • Single card is lower overall power consumption

  • Single card will produce less noise


Update Additional note on performance:


Having had some additional experience with Crossfire and SLI since this post, I should also point out that both will (a) increase your CPU usage, and (b) do not always work properly - or even at all - in many games / apps.


The CPU usage is an issue particularly with Crossfire I found, where it increases nearly 30% or more even on a Quad core machine.


windows 7 - What's the total amount of memory and swap a process is using?

http://windows.microsoft.com/en-us/windows/what-task-manager-memory-columns-mean#1TC=windows-7


If I'm reading correctly, there is no way to see how much swap is used by a process. Is this correct, or am I missing something?


Effectively, the Memory (Private Working Set) is the sum of both the in-memory and swap that's used by the process? Yes/No?


And Commit Size is effectively meaningless, since the description mentions that it's Virtual Memory, and Virtual Memory by itself is free anyways?


For a UNIX user, this terminology and descriptions by Microsoft seem quite confusing.

windows 10 - Cannot delete Steam, path leads to wrong disk


So I am trying to delete Steam. When I do so I get the error:



Windows cannot find 'C:\program Files (x86)\Steam\uninstall.exe'. Make sure you typed the name correctly, and then try again.



The problem is that Steam is not located on the C: drive but the D: drive. I've had similar problems since the last Windows update, but I have solved the problems multiple times by changing the directory in the environment tables.


I've been looking for the Steam directory but can't seem to find it in the menu of the Environment tables.



Answer



Can you make a symbolic link from missing Steam directory to the actual one at D:.


mklink /D "C:\Program Files (x86)\Steam" "D:\Program Files (x86)\Steam"

The method avoids downloading other utilities and uses the included functionality of the operating system


More about mklink.exe can be found at: https://ss64.com/nt/mklink.html


windows xp - MP3 Slice Repetitive Lines


I have a MP3 file where each line of the song is repeated thrice. When I hear it closely, what they have done is they have taken the whole song and somehow identified where each line ends (maybe they have their identifier as the 1 second silence between each line), copied the line and pasted it twice.


The reason why they have done this is, so that we will be able to memorize it easily. Now, what I want is the opposite. I want a software/method, where I identify the gap i.e., 1 second gap and then chop of the repeating 2 instances of the same line.


How do I do it and what software would best be suited for this?



Answer



What you are looking for is Audacity. Also free.


When you open your MP3, it will show you a graphical representation of the track and the splits should be easy to see, particularly if there is a gap. The repeats can be deleted and the track saved.


It will not do it automatically, but it is an easy enough manual task


The graphical representation looks like this - (from wiki.audacityteam.org/) and shows what total silence gaps look like:


alt text


Here is an image of a stereo track with silence gaps. In this image the user has selected part of the recording, shown as shaded, by "click, drag and release". To delete the selected sound all he has to do is hit the Delete key.


alt text


sata - Can I wipe a Samsung 850 Evo SSD by plugging it into another computer through an enclosure and using erase software?


I'm soon sending my computer to a repair shop and I want to wipe my SSD first before sending it in. I detatched the 850 Evo SSD from my computer and was wondering if I could connect it to a laptop through an enclosure like this one and using software to wipe off / secure erase the data. I don't have another PC to plug my SSD in, so I have to rely on this method.



Answer



Yes, you can wipe your SSD by attaching the drive in a USB enclosure to another computer.


However, there is more to consider here:


Due to the nature of how modern SSDs work, a generic wiping utility will not necessarily erase all your data. Fragments of your data can be left, albeit in an unreadable state. Typically, this is "good enough."


However, if you want to properly and securely wipe your SSD clean, leaving no remnants, you must use the SSD's manufacturer specific SSD wiping utility. For Samsung, it is the Samsung Magician Software.


windows 7 - Deleted contents of winsxs folder and BSOD


What can I safely delete from the "C:\WINDOWS" folder?


I deleted the contents of that folder and my Windows 7 BSODs now.


Do I have to reinstall?



Answer



http://www.howtogeek.com/174705/how-to-reduce-the-size-of-your-winsxs-folder-on-windows-7-or-8/



The WinSXS folder contains all Windows system components. In fact, component files elsewhere in Windows are just links to files contained in the WinSXS folder. The WinSXS folder contains every operating system file.



So, yes, you'll have to reinstall.


(I'm curious how you managed to delete those files. That's a system folder, at least some of them would have been in use, and it would've taken some effort to get them deleted.)


How to add users to a FTP site in Windows 7's IIS?

I've setup a HTTPS and FTP site in IIS but how can I add users to use the FTP site?


Does they necessarily need an account with password in the computer to be able to use it?

Asus A53E Laptop in UEFI mode resets BIOS three times before booting

Working with an Asus A53E laptop. Enabled UEFI boot mode in the UEFI program and installed Windows 8.1 x64 successfully last night.


Now, today, when I start up the machine from cold boot, I can clearly hear the hard drive spin up and then immediately spin back down. This process repeats again, and finally on the third time, the drive stays spinning and the firmware logo appears and the system boots normally. During these "reboots", the LCD never powers on - it finally does upon the third reboot before the OS loads.


Clearly it's related to the UEFI mode. I could disable UEFI and go through reinstalling Windows, but was curious as to why this would happen in the first place, and if it really is a problem with UEFI. I would feel like this behavior shouldn't be caused directly by simply having UEFI turned on?


For a spinning drive, these reboots are obviously not the best thing in the world for it. And if nothing else, it adds considerable time to the power-on POST. Through these three cycles I measured about 20 seconds before the LCD even comes on.


Tl;dr - Why would enabling UEFI Boot mode on an Asus A53E laptop cause it to cycle through three POSTs before finally powering on and beginning to load the OS?

combining bourne shell and awk


This is my actual file WASfile


#!/bin/sh
sed -i '/^ *$/d' WASfile
sed -i -e '/user=/,/group_1=/{w /tmp/1' -e 'd}' /home/wasdm/WASfile;
Script to Add
read -p "Press [Enter] to continue for Installation"

Now, I want to put the following script at Script to Add above and then execute the WASfile as script(which is combination of many scripts or commands).


#!/usr/bin/awk -f  

BEGIN { FS="=" }
NR==FNR { a[$1]=$0; next }
$1 in a { $0=a[$1] }
/^#/ { var=$1; sub(/^#/, "", var); if(var in a) { $0=a[var] } }
1

I want to combine and use as below or a better way to combine both the scripts.


#!/bin/sh  
sed -i '/^ *$/d' WASfile
sed -i -e '/user=/,/group_1=/{w /tmp/1' -e 'd}' /home/wasdm/WASfile;
#!/usr/bin/awk -f

BEGIN { FS="=" }
NR==FNR { a[$1]=$0; next }
$1 in a { $0=a[$1] }
/^#/ { var=$1; sub(/^#/, "", var); if(var in a) { $0=a[var] } }
1
read -p "Press [Enter] to continue for Installation"

I am unable to execute the Script.


So, I tried to extract the AWKscript to another file and try to execute that AWKscript. But, the problem is after extracting, the main script WASfile itself breaks or fails.


#!/bin/sh
sed -i '/^ *$/d' WASfile;
sed -i -e '/\/usr\/bin\/awk/,/baba/{w 1' -e 'd}' WASfile;
#!/usr/bin/awk -f

BEGIN { FS="=" } NR==FNR { a[$1]=$0; next } $1 in a { $0=a[$1] } /^#/ { var=$1; sub(/^#/, "", var); if(var in a) { $0=a[var] } } 1
baba
read -p "Press [Enter] to continue for Installation"

as below


#./WASfile
sed: -e expression #1, char 24: missing command
./WASfile: line 6: BEGIN: command not found
./WASfile: line 7: {: command not found
./WASfile: line 7: next: command not found
./WASfile: line 8: in: command not found
./WASfile: line 9: syntax error near unexpected token `/^#/,'
./WASfile: line 9: `/^#/ { var=$1; sub(/^#/, "", var); if(var in a) { $0=a[var] } } '

Answer



From your question I understand that your first script is stored in a file called WASfile. You have to make sure that the script has the executable bit set:


chmod a+x WASfile

Then you can execute the script: ./WASfile. Because the current directory is not in the PATH variable by default you have to explicitly specify the path either for the current directory ./ or the absolute path /home/wasadm/WASfile.


The same applies to the AWK script: make it executable and call it with a specified path.


From the WASfile script you can call it the same way as from the command line. The command line is a shell too - either the same or similar as the shell executing the firs script.


#!/bin/sh
sed -i '/^ *$/d' WASfile
sed -i -e '/user=/,/group_1=/{w /tmp/1' -e 'd}' /home/wasadm/WASfile
/path/to/the/AWKscript inputfile1 inputfile2 >outputfile1
read -p "Press [Enter] to continue for Installation"

The code above will run the AWKscript script stored inside /path/to/the directory. With the files as parameters with the self-descriptory names. Put the files you need there.


Another option is to invoke awk explicitly. In such a case you do not need to enable the executable bit of the file.


awk -f /path/to/the/AWKscript

The last piece of code in the question will not work


The combination showed in your last piece of code will not work. Unix-like systems are designed to execute a single executable file by a single interpreter.


search - Is it possible to get old suggestion system back in Firefox 43.0?


With the new update, the first suggested link is just domain. In older versions, the first suggested link was the page I visited the most and I got used to this great feature.


Is it possible to remove the new domain suggestion, for example "Visit ebay.co.uk"?


See image attachedenter image description here



Answer



Update: This preference no longer exists in Firefox 48.0. See this question for Firefox 48.0.


I noticed this today too and played around in about:config. To get rid of the "Visit website" suggestion you'll need to change a preference. The value you want to change is browser.urlbar.unifiedcomplete, set it to false.


Set it to false: urlbar


Back to normal:


Search Suggestions


Only two monitor ports are detected on nVidia Quadro NVS 450


I have an nVidia Quadro NVS 450 installed in a Dell Optiron 380. Only DisplayPort #1 and DisplayPort #4 are detected by windows. The machine has a BIOS setting to automatically choose the primary video card, or to disable the primary when a PCI-e card is installed (which it is). Windows cannot see DisplayPort #2 and #3 no matter what I do. I have tried the Windows Drivers, latest nVidia Drivers - no dice.


I am assured that this video card cannot break in this way.


I'm plum out of ideas. I've tried reseating the video card. I've contacted Dell and they've remoted in and looked around - threw their arms up after two hours.


Any ideas?


I'm running Windows 7 64-bit. All four monitors are 1600x1200 Dell monitors.



Answer



Get a new Video Card.


Ultimately, the video card was bad. This was true even though our IT team and Dell both said that the graphic card could not break in this manner.


I think the key here is that even if I tried to use port #2 alone it still would not display. Ports #2 and #3 were just dead no matter what I tried. If #2 and #3 worked if I only used those two, then the other answer would have been best.


networking - Is it possible to configure a NAT routing device to have the same subnet on both WAN and LAN interfaces?

Case example for a router (or balancer, NAT gateway... etc):



  • LAN interface (say eth0) with IP 192.168.1.1 on 192.168.1.0/24 subnet. Acting as DHCP (and internet) server.

  • WAN interface (say eth1) with IP 192.168.1.100 on 192.168.1.0/24 subnet. Gateway is 192.168.1.1 (IP corresponding to, say, a DSL router).


Could this work?


If needed, I could add some scheme or graphic.

Thursday, 27 June 2019

windows 7 - Concurrent Connections


How can you see how much concurrent connects you can handle? I use windows 7 and I have read the licensing term and it said Windows 7 has a limit of 20. But, when I got the Half-open limit fix, it said I have no limit. I don't know how I have no limit because I have never played around with anything pertaining that that.


So can anyone tell me a way of testing how many concurrent connections I can handle?



Answer



According to this answer Windows 7 does not have a connection limit anymore. The same is true for Windows Vista with SP2.


Here is a bit more about the topic.


Can I upgrade to windows 10 pro?


I have a genuine windows 8.1 laptop. One of my friend downloaded and made a windows pro pen drive and installed it. Can I install windows 10 pro using the same USB and stay genuine or Do I have to download windows home ?



Answer



You will have the chance to upgrade to 10 via windows update if you registered/register to get the upgrade. It will downloaditself and after it's complete you will be able to upgrade your 8.1 pro to 10 pro.


Copied this:



"By default, Windows 10 builds are pre-keyed, meaning, you do not have to enter a product key and should not be prompted to enter one even after Windows 10 has completed setup if you upgraded from a activated Windows 7 or Windows 8 or Windows 8.1 license."



from here


Other parts of the article say, once you have upgraded to 10 (from 7, 8, 8.1) and activated it you can reinstall competely.



Can I perform a clean install using the Free upgrade? No, it will require that you are running a previous qualifying version and start the upgrade from within the qualifying version. You can initiate a clean install after completing the Upgrade.



Which to which: enter image description here


firefox - In Firebug, how can I stop a redirect?

In Firebug, how can I stop a redirect? I want to examine and edit a webpage before it redirects. Under the Net tab, using Persist I can see all the GET including the previous pages and the redirect page, but I am still taken to the final redirect page. I want to stop one move before this. Is it possible?


EDIT: It is a JavaScript based redirect, but I need the rest of the JavaScript working, so blocking all JavaScript from execution is not a solution in this instance.

conversion - Tool to recursivly convert a HMTL file to PDF?


Are there any tools which not only convert a HTML file to PDF but also follow links, so that in the end I get 1(!) PDF file which contains all html files?



Answer



For a free solution, you could download the site with HTTrack, merge it into 1 file with SoftSnow Merger, then print it to PDF with Bullzip free PDF printer.


A little bit more work, but at a much lower price :)


Connect USB storage device to 2 computers at a time

I'd like to connect an USB storage device to 2 computers at the same time (With a cable, not over the network). Is this possible?


Context: I want my Raspberry Pi to save output on an external USB-storage, and then be able to read the output on a Windows XP PC.

Windows 7: which version for which Pentium?


I have to install Windows 7 on two machines, but I'm not sure if I must pick Windows 7 version 32 bits or 64 bits for each of them. Here's what appears in my computer > properties:



  1. Pentium(R) 4 CPU 3.00GHz

  2. Pentium(R) D CPU 3.00GHz



Answer



Pentium D is better of those two. It's a dual-core vs. Pentium 4 single core, so regardless of what version of Intel pentium 4 you have (x64 or x86), it's faster. Pentium D Smithfield core (90nm) is actually 2x Pentium 4 Prescott cores, and Pentium D Presler core (65nm) is 2x Pentium 4 Cedar Mill cores


Anyway, I would suggest you to check the available memory as well. Minimum for Win 7 x86 is 1 GB, while for Win 7 x64 is 2 GB


If you don't have or you are not planning to use more than 3GB of RAM, I would strongly suggest you to go with the Windows x86, regardless of the CPU ability to work or not on x64 OS


Is there a way to know what the Windows Disk Cleanup utility will delete?

When I run the Disk Cleanup utility that's built into Windows 8, it tells me that it can free up 53GB by deleting 'Temporary Files'. However, a CCleaner analysis on default settings only finds about 300MB worth of space to free up, so I'm wondering what Disk Cleanup has found that CCleaner does not.


Note that this question appears to be similar to what I'm asking, but the accepted answer says that 'Temporary Files' refers to %TEMP%. I've already cleared out most of C:\Users\Cam\AppData\Local\Temp, and it now has only 230MB of stuff in it, even with system files showing.


So where is this 53GB located? Is there a way to find out what it is?


Edit: I should note that this is on a 110GB SSD, so it's almost half the drive. And in fact I'm only using 86GB, so if it's really going to clear out 53GB, that would be more than 60% of the stuff on my C drive. I'm starting to think that Disk Cleanup caches its analysis, and hasn't updated since I started cleaning up the drive earlier today. Although when I run it it says that it's 'Calculating' how much space can be saved, and it takes about 5-10 seconds to do so. Hmmm...


Edit2: Here is what my hard drive looks like, according to SpaceMonger (Right click->Open image in new tab, so you can see it properly): C:\


You can see why I was starting to think that the 53GB figure is actually wrong. Even if 'Temporary Files' includes my hiberfil and everything in WinSxS (about 13GB total), that would be 26GB, which is only halfway there. Hard to see where there's 53GB of stuff to delete.

graphics card - No GUI after upgrade to Ubuntu 9.10 (boots to command line)

I have just upgraded to Ubuntu 9.10 (network upgrade using the update manager, from 9.04 which had different graphics related problems) and when I try to boot into it all I get a small Ubuntu logo, flickering text and then the tty1 command line with a logon prompt.


startx gives following error:


Fatal server error: no screens found

I traced down a tutorial that said I needed the latest graphics drivers (Gigabyte ATI Radeon 4650 HD installed with 9.10 catalyst drivers) so I did using the 'sh' command and a USB stick (I have a working Windows partition) and it installed fine but did not fix the problem.


Edit: Thanks to UK and Arjan below I was able to understand the full error message of start x:


Parse error on lone 2 of /etc/X11/xorg.conf
'nameserver' is not a valid keyword in this section
Fatal server error: no screens found

This has nothing to do with a graphical error (sorry if I misled anyone) but the xorg.conf file has 3 lines in it and lines 2-3 have an entry 'nameserver'. Using the nano command I commented out (using a # before the entries) the nameservers and can now boot Ubuntu.


Thanks to everyone for their help.

scheduled tasks - Windows equivalent to cron?


What's the Windows equivalent to cron, or for those of you unfamiliar with Unix, how does one schedule a program to run at regular intervals?



Answer



Scheduled Tasks:



With Scheduled Tasks, you can schedule any script, program, or document to run at a time that is most convenient for you. Scheduled Tasks starts every time that you start Windows XP and runs in the background, and it starts each task that you schedule at the time that you specify when you create the task.



Also, you should check out this article from Lifehacker on using Scheduled Tasks. It gives examples for Defragging your computer, restarting your computer, and opening Firefox when at startup with a set of websites


How can I reset my windows 7 file permissions to a rational state?

I've messed up my file permissions on my home directory. Here's a small sampling of the output from AccessEnum


enter image description here


How can I fix this so that there's one set of rational permissions, that is


Read and Write for on c:\users\scott (recursively) for Administrators and my own account?


Command line solutions preferred.

macos - where is the .emacs files in Snow Leopard?


where is the .emacs file in Snow Leopard? I need it to configure Emacs.



Answer



emacs will not create the config file for you. If you wish to make configurations you can create the file manually and start your configuration. You should place it in your home directory.


You could also use M-x customize to use emacs's inbuilt customization tool. Any changes saved in customize will be saved in your .emacs file (a new one will be created if one does't already exist).


Magic Mouse scrolling on Windows 8


I've managed to get the mouse detected and the general clicking and mouse moving functionality works fine, but no scrolling, nor gestures?


I'm unsure if gestures are supported, if not that's completely fine.


But does anyone know how to get the scrolling to work?


I assume if the functionality works on Windows 7 it'll also comply with Windows 8. I haven't had any luck with what I've found on the net.



Answer



You may want to look into this utility. It will install the necessary utilities for touch scroll support. Have not verified that it works, but looks promising.


http://www.trackpadmagic.com/magic-mouse/download


browser - How can I download an old version of Google Chrome


For testing purposes, I need to download an old version of Goolge Chrome. I need the stable release of Google Chrome version 69.0.3497.81 to test some of its features. I need to open it and navigate with it (I think this require turning off the updates).


My system is Ubuntu 18.04 64-bit and it has Version 70.0.3538.110 (Official Build) (64-bit).


I could not find any trusted source where I can download an old release of Google Chrome. I find some shady websites with .exe files and I do not want to download from them for security reasons.



Answer



Google does not offer older Versions of Chrome, in the name of Security.


You may find older versions on The Chromium Project, although the version may differ slightly on the last number component.


You may have a look at some Chrome clones. For example, Slimjet is a Webbrowser based on Chrome does provide some older versions of Chrome. To download visit the Slimjet Site to access the archive, where I found version 69.0.3497.92 as the closest.


For Chrome/Chromium itself, there are great difficulties in finding older versions.


Here are some possibilities (which I haven't tried) :



windows 7 - My HP laptop shows a BIOS error


Sometimes, when I startup my HP laptop I get a message like this (I am not accurately sure of the message but it is something like this)



HP Bios Startup error


The selected bios file was not found. It is either corrupt or missing


Please visit http://hp.com/go/techcenter/startup


Please Press ENTER - to Continue.



When I press enter nothing bad happens, My system just starts up normally. I have had a similar problem with my desktop but whenever I press enter the computer restarts and doesn't startup. I was told that a virus had attacked my system.


I am very worried. Is the same thing happening here?, How will it affect my system? and What can I do?



Answer



i suppose that your laptop bios is UEFI (Unified Extensible Firmware Interface). Most likely that the HP_TOOLS EFI is missing form the system. If you formatted/reformatted or replaced your HDD/SSD it could be that there is no efi-partition (HP_Tools) installed.


I think that correct error message is:



The HP BIOS application selected is corrupt or missing. Please install the application and try again.


BIOS Application Error (501)


Enter - Continue



To fix this do the following:




  1. Enter your BIOS by pressing F10 (I think) while booting up

  2. Navigate to System Configuration / Device Configurations

  3. Find the option called HP Quicklook or HP Quicklook 2 and set it to Disabled

  4. Save the changes and exit



This should get past this message


Wednesday, 26 June 2019

video - FFmpeg - Apply blur over face


I'm trying to blur a portion of a video using FFmpeg (specifically to blur a face).


I have been trying to use a combination of timeline editing and the various bluring filters, but I cannot find a way to blur only a section of the video.


I'm hoping for something like:


-vf boxblur=enable='between(t,10,100)':width=20:height=20:x=400:y=200

Where width/height is size of blurred box and x/y are location of blurred box.


Is something like this possible?



Answer



It is possible to apply temporal and spatial blurring to a segment/section – assuming the area you want to blur is a static location.


Black lab pup
Original black lab pup image.



enter image description hereenter image description here
Grayscale PNG mask image and resulting blurred image.


You can make a grayscale mask image to indicate the area to blur. For ease of use it should be the same size as the image or video you want to blur.


Example using alphamerge, boxblur, and overlay:


ffmpeg -i video.mp4 -i mask.png -filter_complex "[0:v][1:v]alphamerge,boxblur=10[alf];[0:v][alf]overlay[v]" -map "[v]" -map 0:a -c:v libx264 -c:a copy -movflags +faststart maskedblur.mp4



  • The white area is where the blur will occur, but this can easily be reversed with the negate filter for instance: [1:v]negate[mask];[0:v][mask]alphamerge,boxblur=10[alf]...




  • You could use the geq filter to generate a mask such as a gradient.





Black lab pup with blur effect


ffmpeg -i derpdog.mp4 -filter_complex \
"[0:v]crop=200:200:60:30,boxblur=10[fg]; \
[0:v][fg]overlay=60:30[v]" \
-map "[v]" -map 0:a -c:v libx264 -c:a copy -movflags +faststart derpdogblur.mp4

Note: The x and y offset numbers in overlay (60 and 30 in this example) must match the crop offsets.


What this example does:



  1. Crop the copy to be the size of the area to be blurred. In this example: a 200x200 pixel box that is 60 pixels to the right (x axis) and 30 pixels down (y axis) from the top left corner.

  2. Blur the cropped area.

  3. Overlay the blurred area using the same x and y parameters from the crop filter.



enter image description here
Blurred areas in top left, near center, and bottom.


"[0:v]crop=50:50:20:10,boxblur=10[b0]; \
[0:v]crop=iw:30:(iw-ow)/2:ih-oh,boxblur=10[b1]; \
[0:v]crop=100:100:120:80,boxblur=10[b2]; \
[0:v][b0]overlay=20:10[ovr0]; \
[ovr0][b1]overlay=(W-w)/2:H-h[ovr1]; \
[ovr1][b2]overlay=120:80"


enter image description here


"[0:v]boxblur=10[bg];[0:v]crop=200:200:60:30[fg];[bg][fg]overlay=60:30"

Additional stuff



How can I VLOOKUP in multiple Excel documents?

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