Monday, 31 December 2018

linux - Unable to remove package on Debian 7


I have a damaged installation of MariaDB which I am trying to clean out and re-install.


If I do sudo apt-get upgrade I get the following remove:


You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
mariadb-galera-server : Depends: mariadb-galera-server-5.5 (= 5.5.40+maria-1~wheezy) but it is not installed
E: Unmet dependencies. Try using -f.

If I run sudo apt-get install -f I get:


Preconfiguring packages ...
(Reading database ... 31610 files and directories currently installed.)
Unpacking mariadb-galera-server-5.5 (from .../mariadb-galera-server-5.5_5.5.40+maria-1~wheezy_amd64.deb) ...
Stopping MariaDB database server: mysqld failed!
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 1
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing /var/cache/apt/archives/mariadb-galera-server-5.5_5.5.40+maria-1~wheezy_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-galera-server-5.5_5.5.40+maria-1~wheezy_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I try to uninstall using sudo apt-get --purge remove mariadb-galera-server-5.5 mariadb-galera-server mariadb-common I get:


The following packages have unmet dependencies:
libmariadbclient18 : Depends: mariadb-common but it is not going to be installed
mariadb-client-5.5 : Depends: mariadb-common but it is not going to be installed
mariadb-client-core-5.5 : Depends: mariadb-common but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I have run out of things to try, any help is much appreciated.



Answer



This seems to be a known issue as reported here. The most practical solution would be to first kill of all instances of mysqld that are running:


sudo killall mysqld

And then run this as suggested to get things running with MariaDB again:


sudo apt-get -f install

If somehow that doesn’t work, run dpkg --configure -a before the previous commands and try again.


Set Outlook 2010 (Exchange) to check email less often

I'd like to have Outlook check my email less often. I know about Send/Receive Groups, but as I understand it, if it's checking email through Exchange, that setting doesn't matter and email checking is instantaneous. To avoid workflow disruption, I'd like it to only show me new emails every 30 or 60 or whatever minutes. Is there a way to do that from the user's end (I am not an admin)? I can do it manually by clicking "work offline," but I'd like to have Outlook do this for me.


thanks, Ben

internet explorer 8 - IE8 Printing Issue - Shrink to Fit is not Shrinking, right side getting hacked

I'm having this problem in a Sharepoint Extranet site. Several long/wide forms and grids are getting their right sides hacked off when printed. In IE7, Shrink to Fit solves this problem. However in IE8, when I go into Print Preview, it SAYS it's set Shrink to Fit but it is not actually shrinking.

malware - Windows 10 Disk Usage at 100% but no corresponding process shows in task manager

Over the past month (possibly more), I have noticed that my laptop (running Windows 10) frequently becomes almost unusably slow, especially after many days of not having turned it on.


I notice that the disk usage in the task manager is at 100% for long periods of time, however this is ridiculous because even the sum of all the processes [that I can see...] could only approach about 5-10% in the generous case.


This is a development machine with 8GB RAM, i7 processor, plenty of space. There are almost no startup programs other than MS default programs (and even there I culled most of the non-essentials out of the startup list). I have also gone through and progressively disabled services such as BITS, Superfetch etc. to no observable effect.


What makes this more suspicious is the pattern in which it occurs - the issue is worst at startup after many days of the computer being physically disconnected and turned off. The startup time is around 3-5 minutes (!) after which the disk runs at 100% usage for a few minutes and then for no explicable reason, suddenly drops down to around 1-5%. All this without showing any processes near full disk usage.


After around a month of investigating this, I am beginning to suspect the involvement of malware, particularly because of the discrepancy in the task manager but also because of how the issue suddenly corrects itself. I should also note that the computer runs AVG Free edition and scans of the computer and anti-rootkit are coming up clean. That being said, I want to pursue the possibility that this could be malware connecting and updating itself, or even worse, exfiltrating data [or even worse, chewing my disk to encrypt my files while telling me everything is OK]?


Currently I do not observe an irregular amount of network traffic which would support the exfiltration theory, however it is also possible to hide this from the task manager / wireshark using a rogue driver.


I have a number of questions:



  1. Does this pattern of behavior fit any known malware / APT threats?

  2. Supposing I were to continue this into the forensics direction, what further steps could be taken to investigate and validate the drivers on the machine?

  3. What steps beyond task manager can I take in order to monitor and identify the process which is actually responsible for the 100% disk usage?

  4. Are there any legitimate / Windows reasons this might be occurring and if so, how can I narrow down and isolate the problematic components?

linux - Convert Setup Script (BASH) To Ask Password Only Once?

I have a script that I use to set up my laptop automatically with all of my settings. I experiment with different Linux distributions constantly on this laptop, so it is very useful to have a script like this to pull in all my settings fresh after an install. It works well, but it asks for my password multiple times. I know it's because I'm using scp multiple times, but I'm not quite sure if maybe my password can be cached and reused for the rest of the script after the first entry?


Here is the script: http://pastebin.com/gHFr91Lf

windows 10 WSL ubuntu unable to ping anything


I cannot ping any website when I am using WSL for windows 10. I'm running Ubuntu 18.04 in WSL.


--- google.com ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 38567ms

is the result when I try ping google.com I am using windows 10 with IPv4, disabled IPv6. I can ping google.com normally without wsl on my regular command prompt


I'm running Avast internet security and when I ping google from inside the ubuntu/WSL instance this is what I see.


1: enter image description here


What do I need to do to enable pinging in WSL



Answer



First some background. One should need Windows 10 Build 17627 or higher to support Firewall with WSL connections. Here is the section from WSL release notes:



Build 17627 (Skip Ahead)


WSL



  • Windows firewall support for WSL processes. [GH 1852]

    • For example, to allow the WSL python process to listen on any port, use the elevated Windows cmd: netsh.exe advfirewall firewall add rule name=wsl_python dir=in action=allow program="C:\Users\\AppData\Local\Packages\canonicalgrouplimited.ubuntuonwindows_79rhkp1fndgsc\localstate\rootfs\usr\bin\python2.7" enable=yes

    • For additional details on how to add firewall rules, see link





Next step, find absolute path of the Linux executable that wants Internet connection. The full path can be divided into three parts:



  1. C:\Users\UserName\AppData\Local\Packages -- Path where Universal Windows Platform apps store user specific files, temporary files etc.

  2. CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs -- Path where Ubuntu 18.04 Appx package store Ubuntu usersapce files i.e. /bin, /etc, /usr and others.

  3. \bin\ping -- Linux ping binary.


Hence the whole path is:


C:\Users\UserName\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\bin\ping

You can use the following PowerShell script to get that path. Just enter ubuntu when it asks to enter Distribution name.


$DistroName=Read-Host "Enter Distribution Name"
$pacakgeName = (Get-AppxPackage *$DistroName*).PackageFamilyName
$appData = [System.Environment]::ExpandEnvironmentVariables("%LocalAppData%")
$InstallDir = $appData + "\Packages\" + $pacakgeName + "\LocalState\rootfs"
echo $InstallDir
Invoke-Item $InstallDir
Read-Host -Prompt "Press any key to continue..."

Final step, add the firewall rule. For Windows Firewall, run this command as administrator to add Outbound firewall rule.


netsh.exe advfirewall firewall add rule name=wsl_ping dir=out action=allow program= enable=yes

For Avast Firewall, follow this instruction from Avast Support. Open Settings > General > Exclusion and add the path from previous step.


Canonical answers:



Programmatically read "Turn off hard disk after" value in Windows


I'm looking for a way to programmatically read the current setting of the "Turn off hard disk after" value, located in the advanced power options in Windows 7 and later.


I'm aware of the


powercfg -change disk-timeout-ac xx


and


powercfg -change disk-timeout-dc xx


commands to set this value. However, there does not seem to be an equivalent command to read the currently set value. Also, I couldn't find a registry setting for this.



Answer



Since you're asking on Super User instead of Stack Overflow, I'll focus on the scriptable (Registry) way of doing this.


The power settings are all accessible in the Registry under this key:


HKLM\CurrentControlSet\Control\Power

The User\PowerSchemes subkey has an entry called ActivePowerScheme which - as you might guess - contains the ID of the current power plan. All IDs relating to power management are GUIDs, but my quick surveys show that the default ones are the same on all machines. The subkeys of PowerSchemes are, well, power schemes. 381b4222-f694-41f0-9685-ff5bb260df2e, for instance, is Balanced (recommended).


power options


The subkeys of the power scheme keys are categories as they appear in the advanced power options. These are defined in the PowerSettings subkey of Power. For instance, 0012ee47-9041-4b5d-9b77-535fba8b1442 is Hard disk as seen in the above image. The subkeys of those are the individual settings. 6738e2c4-e8a5-4a42-b16a-e040e769756e is Turn off hard disk after. Those keys have a DefaultPowerSchemeValues subkey, which has a subkey for every standard power plan. Those keys have an AcSettingIndex and a DcSettingIndex entry which are exactly what you think. The units used vary from setting to setting; this one uses seconds. So, you can see that the default hard drive power-off timeout for the Balanced power plan is 1200 seconds (20 minutes) when plugged in and 600 seconds (10 minutes) on battery.


registry defaults


Now back to the User\PowerSchemes key. Since the user might not have ever changed the settings, there's no guarantee that the key will have both AC and DC setting entries, the setting subkey, or even the category subkey. If the value you're looking for isn't there, you'll need to check the default value for the current power plan back in PowerSettings\DefaultPowerSchemeValues.


Note that while everybody can read these keys and values, not even Administrators can write. That's because power settings are supposed to be managed through the Power service, which runs as SYSTEM.




Developers of compiled (C++) applications should use the documented interface for power management. Call GetCurrentPowerPolicies, get the user part of the POWER_POLICY structure, and look at the SpindownTimeoutAc and SpindownTimeoutDc values.


network interface - Sharing LAN between two buildings. What should I use?

I need to connect two buildings to share LAN and internet connection between them. They are 20m apart, but from the two end points I would need about 90m of cable. I know that the maximum of UTP is 100m, so it would be feasible with it, but I don't know how to connect the two buildings. As far as I know, UTP is vulnerable to weather, so it wouldn't be wise to just stretch the cable in the air between the two. Optical cable is out of the question because of the high costs.


What would be the best?


Edit: Ok, I think WIFI is a good alternative, but I'll still need to pull a cable from the endpoint to the other end of the building. Is it a good way if I get about 50m of UTP to a WIFI bridge and then the two wifi bridges will connect the two bldgs? Wouldn't this make the network unstable?

language - Get Cortana to work in English (UK) for Windows 10

I upgraded to Windows 10, and Cortana doesn’t seem to be available based on the Start Menu:



Cortana isn’t supported in the region and language you’ve selected.



Start Menu screenshot


but when I click the link, it takes me to this page:


screenshot of help page


which suggests it should be available in the UK, since I've checked



  • my language settings are English (UK),

  • I have the English (UK) language pack installed, and

  • the speech settings are also set to English (UK).


I think this is everything, right?  It certainly ticks the boxes in the Microsoft help article.


How can I get Cortana up & running?

Ubuntu does not boot due to disk space full


I'm using Ubuntu 13.10. When I boot Ubuntu it does not start and just shows a blank screen. I tried cntrl+alt+f1 and using df -h I saw that my /dev/sda7 is completely full. I can't even remove old kernels due to low space. I cannot start Ubuntu, please help.



Answer



Ubuntu has started if you are able to do commands, it is just the gui you are missing. Now you just need to delete things with the rm command.


Please be careful, and make sure you understand what you are doing.


Perhaps you can delete some old logs? In the /var/log folder there are lots of logs.


Anything ending in a number such as .1, or a number with a gz suffix - .2.gz is an old log file. It is fairly safe to delete these.


However, you can use the du -shx /* command to see which of the root directories is using the most space. It is likely to be the /home/ directory, and your own home directory. Probably email or dropbox is taking up the most room.


linux - Way to write a bootable CD to a partition?


Arch-Linux comes with the best recovery CD I have ever come across. Although I don't always have it with me, so I want to have it on a partition.


What I would like to do is have this CD on a partition on my hard drive that I can boot from, without having the CD with me. Because sometimes I might not have it, and the recovery kernel is broken (example: a recent mkinitcpio kernel build). Is there a way, either using dd, or another external program to write it to a partition? Or is there a way to emulate a disk with just the .ISO?



Answer





  • dd will help you make the partition which is capable of making the system boot through it. We are basically doing the same thing to the USB drive to make it bootable.




  • However, you cannot tell you BIOS to boot through a partition, and hence you will need to configure your GRUB to boot through that partion using:





rootnoverify (hd0,n)
chainloader +1
boot



Where n is the partition number.


windows 7 - How can I delete over 2,000,000 files in a single directory efficiently?


I have over 2,000,000 (that's right, over 2 million) files in 'Temporary Internet Files'.


This predicament is the result of a scheduled task that runs a script. After installing Visual Studio, it has been generating numerous 'Assembly Binder Log Entry' .HTM files each time it runs.


It's been doing this every 15 minutes for 8 months. So now there's over 2,000,000 and 8 GB worth of these files in there (no wonder WinDirStat and Everything have been crashing!).




How can I delete a folder without iterating over all 2,000,000 of its contents?


I tried opening the parent folder in Explorer and simply pushing the Del key. Windows then proceeded to attempt sending 2,000,000 files to the Recycle Bin (nope). It never got past the 'Discovering Items' phase.


I went for PowerShell next (Remove-Item 'Content.IE5'), but it's attempting to recurse through each file and delete them individually. While this seems like it will work eventually, I feel like there must be a better way.


Bonus points if you can tell me what the heck Assembly Binder Log Entry files are...



Answer



According to a similar question from StackOverflow there are a couple things you can do. Quoting from the highest rated answer (not the accepted) the best method of doing such as task is:



The best I've found is a two line batch file with a first pass to delete files and outputs to nul to avoid the overhead of writing to screen for every singe file. A second pass then cleans up the remaining directory structure:



> del /f/s/q foldername > nul 
> rmdir /s/q foldername

Obviously you will need to adapt this answer to suite your specific purposes since you are deleting a series of files rather than a folder.


This user suggests (and I would agree) the worst way to achieve such a task would be select all and Del with next worst being select all Shift+Del


Afraid I have no idea what the log entry file is.


Source - stackoverflow


Sending Files Via Bluetooth

Is there any way of sending files through bluetooth, from one computer to another?

networking - Can you run DSL and T1 through a single switch for two different purposes?

I'm not quite sure this works, but my co-worker says it will. Details first: We have a small office of less than 10 PCs, and we use VOIP for our business phone line. All PCs require internet access. Now then, we used to run everything through the DSL line, but it would slow down a lot, so we recently had a separate T1 line installed, with 10 dedicated IPs. Our office is equipped with one switch, and the idea came up to separate PC traffic from VOIP traffic.


My co-worker suggested that we connect the T1 line to our switch and use the dedicated IPs for each PC. Then we connect the DSL line to a router and connect that router to the SAME switch, so that it can use DHCP for the VOIP phones. The end result would be that all office PCs would be using the T1, and all office VOIP phones would be using the DSl line. One small catch: There is only one network wall socket in each office (all connected to the switch), and the current office setup has each PC connected to the VOIP phone, and then the VOIP phone connected to the wall socket.


Is this possible? Two different internet connections (DSL and T1) through the same switch, two different machines (PC and VOIP phone) essentially sharing one connection to the switch (since the VOIP phone sits inline with the PC), and having the PC only use the T1 and the VOIP phone only using DSL?

USB keyboards repeat rate seem slower than PS/2

Long ago, I've had a PS/2 keyboard but lately have switched to USB keyboards, namely Microsoft Comfort Curve and then Microsoft Natural 4000.


What I've noticed is that these USB keyboards have quite slower repeat rates than PS/2 keyboards. I always set repeat rate to maximum since I use arrow keys much, in text editors, in Total Commander and in this very edit field. So it's sometimes annoying that I scroll through text slower than before.


So, does anyone know of a way to raise the repeat rate on these keyboards? Or is it caused by the hardware?


Note than IntelliType software is not installed. I've set it up previously but the rate is not affected by it.

cmd.exe - Change working directory to network share


I can list all files in a folder with: dir \\aenw08v401\FOLDER\I001\*


However, when I execute cd \\aenw08v401\FOLDER\I001, the current working directory won't change at all.


This is what I see when I execute net view \\aenw08v401:


Shared resources at \\aenw08v401
Share name Type Used as Comment

-----------------------------------
FOLDER Disk
The command completed successfully.

Is there a switch I am missing, or do I need to use a different command?



Answer



The Windows command prompt cmd does not support UNC paths as current directories.


C:\Users\User1>cd \\myServer\myShare
CMD does not support UNC paths as current directories.

Solution: Use pushd.


C:\Users\User1>pushd \\myServer\myShare

Z:\>dir
Volume in drive Z is MYDRIVE
Volume Serial Number is 1234-5678

Directory of Z:\

12/16/2015 11:18 AM
.
12/16/2015 11:18 AM
..
0 File(s) 0 bytes
2 Dir(s) 120,609,575,936 bytes free

Z:\>popd

C:\Users\User1>

Alternate Solution: Map the UNC path to a drive letter.


C:\Users\User1>net use Y: \\myServer\myShare 
The command completed successfully.

C:\Users\User1>Y:

Y:\>dir
Volume in drive Y is MYDRIVE
Volume Serial Number is 1234-5678

Directory of Y:\

12/16/2015 11:18 AM
.
12/16/2015 11:18 AM
..
0 File(s) 0 bytes
2 Dir(s) 120,609,575,936 bytes free

Y:\>C:

C:\Users\User1>net use /delete Y:
Y: was deleted successfully.

How to prevent automatic update to Firefox 57.0 Quantum?


So at work, my Firefox got automatically updated to 57.0 (Quantum) since I have automatic updates enabled.


Turns out that a lot of add-ons don't work anymore with 57.0, e.g. the session manager and the tab group add-on which I use extensively. It seems that I lost all but the current tab group which I'm not very happy about...


Now, at home I use the same add-ons and I'd like to prevent losing my tab groups so I'm looking for a way to disable automatic updates (which are enabled) before I start Firefox so that I get a chance to save/export my tab groups and find a solution that will work with 57.0 before actually updating to 57.0.


How can I do that?



Answer



The solution to disable automatic updates without running Firefox is as follows (OS is Windows):



  • Edit the file prefs.js, located in %APPDATA%\Mozilla\Firefox\Profiles\xyz.default\ which usually translates to C:\Users\username\AppData\Roaming\Mozilla\Firefox\Profiles\xyz.default\ (Note: username and xyz will vary)

  • Make sure the line user_pref("app.update.enabled", false); is present in the file; if it isn't, add it or modify it. Ignore the warning that this file should not be edited

  • Save and close the file

  • Start and use Firefox without having to worry about automatic updates

  • Optional: Note the button "Check for updates" in the "About Firefox" dialog box. Of course, DO NOT click it until you are prepared and ready to receive the update


automation - How to turn Out of Office on automatically when Outlook is closed?


Is it possible to make Outlook 2010 turn on the "Automatic Replies" feature when I close the application? I like to turn on "Out of Office" at the end of the day but in a hurry it's easily forgotten.



Answer



I REALLY tried to make this work for you, but I learned that Outlook 2010 no longer supports CDO 1.2.1, and not being a programmer, I did not have the deep knowledge to code it another way. Although unsupported and not recommended by Microsoft (why do they mention it then??), it is possible to install CDO if you have Outlook 2007, before you upgrade to Outlook 2010.


http://support.microsoft.com/kb/2028411


I am going to post how to do this in Outlook 2003/2007 in case anyone happens upon this. I just tested this. I will also post the other steps for Outlook 2010 ASSUMING YOU CAN FIX THE CODE.


For Outlook 2003/2007




  1. For Outlook 2007 only, you must install CDO or the code will fail: http://www.microsoft.com/downloads/en/details.aspx?familyid=2714320d-c997-4de1-986f-24f081725d36&displaylang=en




  2. Assuming your company's group policy does not override this, change the security in ToolsMacrosSecurity to No Security Check for macros.




  3. Go to ToolsMacrosVisual Basic Editor.




  4. Click on the Visual Basic icon, and hit F2 to open the objects browser.




  5. In the new project in the left pane expand it until you see ThisOutlookSession and double-click it.




  6. Cut and paste the following code into the code window that just opened and save it:


    Private Sub Application_Quit()
    Dim objMAPISession As Object
    Set objReminders = Nothing
    If MsgBox("Would you like to turn the Out of Office Assistant on?", vbYesNo, "Activate Out of Office Assistant") = vbYes Then
    Set objMAPISession = CreateObject("MAPI.Session")
    objMAPISession.Logon , , True, False
    objMAPISession.OutOfOffice = True
    objMAPISession.Logoff
    End If
    Set objMAPISession = Nothing
    End Sub


  7. Close and open Outlook.




  8. It will give you a message about macros. Enable them.




For Outlook 2010


If you can fix the code, here are the steps for Outlook 2010. I include them because the locations of many items have changed, and could be hard to find. In the current code, I also point out the step that fails.




  1. Assuming your company's group policy does not override this, change the security in FileOptionsTrust CenterTrust Center SettingsMacro Settings to Enable all macros.




  2. Start by enabling the Developer tab in FileOptionsCustomize Ribbon, check Developer in the right column.




  3. Click on the Visual Basic icon, and hit F2 to open the objects browser.




  4. Go to Classes (left column) → ThisOutlookSession and double-click it.




  5. Cut and paste the following code into the code window that just opened and save it:


    Private Sub Application_Quit()
    Dim objMAPISession As Object
    Set objReminders = Nothing
    If MsgBox("Would you like to turn the Out of Office Assistant on?", vbYesNo, "Activate Out of Office Assistant") = vbYes Then
    Set objMAPISession = CreateObject("MAPI.Session") THIS IS THE STEP THAT FAILS
    objMAPISession.Logon , , True, False
    objMAPISession.OutOfOffice = True
    objMAPISession.Logoff
    End If
    Set objMAPISession = Nothing
    End Sub


  6. Close and open Outlook.




  7. Go back to the Developer tab → Macros icon. It will give you a message about macros. Enable them.




Sunday, 30 December 2018

Cisco VPN client on Windows 10?

I have been able to get the Cisco VPN client, the one which goes by the name vpnclient-winx64-msi-5.0.07.0440-k9, on Windows 8.1 x64 machines. Now I have a Windows 10 TP machine.


Has anyone gotten this client to install on 10? I get the following:


Error 27850. Unable to manage networking component. Operating system corruption may be preventing installation.


Ring any bells? I also cannot get the Citrix DNE installed. Very similar message.


enter image description here

How can I delete all web history that matches a specific query in Google Chrome


In Google Chrome, is it possible to delete all search history that matches a specific query (for example, en.wikipedia.org)?



Answer



Update Jan 2019


Now Chrome supports the keyboard shortcut CtrlA or A




Original answer


You can take the hacker shortcut injecting JavaScript code.


Step 1 Since Chrome history is queried inside a iFrame, we have to visit: chrome://history-frame/ (copy and paste URL)


Step 2 Do the search query.


Step 3 Open the Chrome console(F12 or CtrlShifti or i) and execute:


var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; ++i) {
if (inputs[i].type == "checkbox"){
inputs[i].checked = true;
}
}
document.getElementById("remove-selected").disabled = false

Step 4 Hit the 'Remove selected items' button.


Actually this deletes the elements in the current page. I might try to extend it, but it's a good starting point. Read the full article in my blog.


Is it possible to set a style to show line continuations in Microsoft Word?

Sorry if the title is a little unclear. Here's the situation:


I have a bunch of code in a Word document, with a style specifically for code. However, in a few cases it is not clear that a line has been wrapped, and so in these places I have manually added a "↵" glyph to indicate the wrapping.


Would it be possible to make Word do this automatically?


For the sake of clarification: I need this to show in normal document view (not just when non-printable characters are shown) and when the document is printed.

firefox - How to set the default encoding to Unicode?

How do I set the default encoding in Firefox/Iceweasel to Unicode (instead of Western)?


I'm particularly interested in the default encoding for *.txt files. Firefox/Iceweasel seems to always choose Western as the encoding for such files. I know that I can change the encoding for a particular page through View > Character Encoding, but it gets tiresome after a while.

windows 7 - Open the start menu using Powershell

Am currently working on a business process automation software and literally user actions are simulated by robots. I need to pass some information to the start menu of my windows 7 and i was wondering if the windows start menu could be opened using a powershell script? As the information to open a powershell can be understood by the robots. Please any suggestions would be nice.

security - Are anti-static wrist bands really safe?

Is grounding oneself using anti-static wrist band (connected to ground wire & having a protective resistor) still dangerous in case a very high current flows through the ground wire (due to some short-circuit/ faulty lines)?


Will the power rating of the resistor (generally 1 Mega ohm 1/2 Watt resistor used) be sufficient in case a very large current surges through the ground wire & a person is grounded with it (via anti-static wrist band)? Or do we need to use a higher Watt resistor (power rating > 1/2 Watt) to take care of this particular situation?

How to allocate more processor power to my (Ubuntu-based) Virtualbox system in Windows 7?


I have installed an 32-bit Ubuntu based Linux OS, Elementary, on a VirtualBox installed in Windows 7 (32 bit) , on a 64-bit laptop which has a 2-core Intel i3-2330 CPU @2.20Ghz, and 4GB RAM (2.45 usable).


I have allocated 1.2 GB RAM to the virtual system and left the CPU allocation default. The VM processor setting looks like so:


enter image description here


The Linux VM system is too slow.


Looking at the Task Manager in Win7 and at System Monitor in Linux, I can see that this is probably not because of the amount of RAM used, but because the virtual Linux has too little processor power. In Windows, VirtualBox takes 25% of CPU power and only about 160 MB of RAM (summing up the 4 instances that I see). In Linux, not even half of the 1.2 GB of RAM are normally used, while the CPU resources seem used 100% all the time.


Can I allocate more CPU resources to the VM? How to do that? Can I do that for the system that is already installed in VM or should I re-install the virtual OS?


CPU-Z displays this about the CPU in Windows:


enter image description here


My purpose is to use the Linux from time to time while not using Windows 7, so, I would prefer VirtualBox to take more of the CPU resourses from Windows, because I will not be needing those when using the VM. (I am aware that my purpose would be suited better with a dual-boot installation of the Linux system, but the GPU on this laptop doesn't have the proper drivers in Linux: it heats up so hard that the computer is shut down before the Linux is even installed, or before installing the proper drivers etc.)



Answer



Getting a host computer that's running something better than an i3 would be the real answer (IMO). :)


Regardless of that...


The reason it's using 25% at most is because your i3 has 2 cores, but 4 threads, so the host sees it as 4 processors.


The VM is set to use only one of them, up to 100%, so when it's maxed out it's using only 25% of the total CPU power of the host.


For setting up VB to allow more than 1 virtual CPU, additional settings need to be configured:




  • enable I/O APIC in the Motherboard settings tab


    enter image description here




  • enable hardware virtualization (VT-x/AMD-V) in the Acceleration tab


    enter image description here




To avoid problems, don't set it any higher than your number of PHYSICAL cores; so in your case, don't try to use more than 2 virtual CPUs.



You should not configure virtual machines to use more CPU cores than you have available physically (real cores, no hyperthreads).




If the Acceleration options are not available, ensure you have enabled virtualization technology in your BIOS.


boot - How to check root partition with fsck?


I installed Linux Mint 12 KDE, and I would like to check the root partition for any errors.


How do I check the root partition with fsck at boot time?



Answer



sudo touch /forcefsck

Then reboot.


microsoft edge - How to run Internet Explorer 7 on Windows 10

I have Microsoft Edge, but I need Internet Explorer 7 as a web site I am accessing will only open with this. I downloaded Internet Explorer 7 and it said it was not compatible. How do I make this work?

fonts - What sort of character is this (𝒲)


I recently came across this answer on Sci-Fi Stack Exchange. It appears to be written in a font designed to look like hard-to-read, old fashioned handwriting. As such, to make it easier to read, I copy/pasted it into gedit (a text editor that does not support formatting — like Notepad). To my surprise, the strange formatting stayed. Upon further inspection (i.e., Googling the most strange looking characters, noticing the year appears to be written partially normally) I came to the conclusion that they are a set of strange letter-like characters in Unicode.


My question has two parts:



  1. Am I correct about what these characters are?

  2. If so, why does Unicode contain extra characters that appear to serve no purpose other than that of fonts?



Answer



It is the Unicode character U+1D4E6 – Mathematical Bold Script Capital W.


The letter is from the Unicode block ‘Mathematical Alphanumeric Symbols’. It is used by mathematicians to distinguish different objects, e.g., different sets. In Word, the character is accessible by Insert Equation → Symbols → Scripts.


As the character set looks kind of ancient, you can of course write regular text in it as well, e.g., a Sci-Fi story.


windows 7 - Hiding folders from Specific Users


I use computers in a shared house, the computers are running Windows 7 and Windows Vista and are connected to a network with Windows Server 2003 as the DC. I want to hide certain folders from other users, and not just using the hidden folder attribute. I know I can limit the permissions on folders to grant / deny users acees but was wondering if there is a way just not to display the folders to certain users so they don't even know they're there. e.g. User A will see the contents of the S drive asFolder1, Folder2, Folder3. User B will see the contents of the S drive as Folder1, Folder2. Perhaps I'm looking at this the wrong way but any advice would be appreciated.


I'm going along the mothod of "What people don't know is there they aren't curious about"



Answer



Sounds like you need Access Based Enumeration


audio - Sound doesn't work after hibernate.

The last few times that I woke my PC out of hibernate, the sound wasn't working. I re-enabled the sound card and reinstalled the driver. It still isn't working. When this happens, Flash will crash when I use it. iTunes doesn't work, just as some other programs.


Specs:
Gigabyte GA-MA790x-UD4P and it's on-board sound card
AMD Phenom II x4 955
ATI HD4890
2x2GB G.Skill Ripjaws
Western Digital HDD (not sure which one)
Windows 7

There seem to be a lot of errors coming from ShellHWDetection, MMCSS and AeLookupService, in my log.


Sample of a ShellHWDetection error:


System 

- Provider

[ Name] Service Control Manager
[ Guid] {555908d1-a6d7-4695-8e1e-26931d2012f4}
[ EventSourceName] Service Control Manager

- EventID 7011

[ Qualifiers] 49152

Version 0

Level 2

Task 0

Opcode 0

Keywords 0x8080000000000000

- TimeCreated

[ SystemTime] 2011-11-26T11:39:30.513091900Z

EventRecordID 545363

Correlation

- Execution

[ ProcessID] 624
[ ThreadID] 5176

Channel System

Computer Simon-PC

Security


- EventData

param1 30000
param2 Schedule

Sample of a MMCSS error:


    System 

- Provider

[ Name] Service Control Manager
[ Guid] {555908d1-a6d7-4695-8e1e-26931d2012f4}
[ EventSourceName] Service Control Manager

- EventID 7011

[ Qualifiers] 49152

Version 0

Level 2

Task 0

Opcode 0

Keywords 0x8080000000000000

- TimeCreated

[ SystemTime] 2011-11-26T11:39:30.513091900Z

EventRecordID 545363

Correlation

- Execution

[ ProcessID] 624
[ ThreadID] 5176

Channel System

Computer Simon-PC

Security


- EventData

param1 30000
param2 Schedule

And a sample of an AeLookupService error:


- System 

- Provider

[ Name] Service Control Manager
[ Guid] {555908d1-a6d7-4695-8e1e-26931d2012f4}
[ EventSourceName] Service Control Manager

- EventID 7011

[ Qualifiers] 49152

Version 0

Level 2

Task 0

Opcode 0

Keywords 0x8080000000000000

- TimeCreated

[ SystemTime] 2011-11-26T12:12:00.755639300Z

EventRecordID 545446

Correlation

- Execution

[ ProcessID] 624
[ ThreadID] 5908

Channel System

Computer Simon-PC

Security


- EventData

param1 30000
param2 AeLookupSvc

windows xp - Replace, not merge, folders when copying


In Windows Vista, when I try to move a folder to replace an existing folder, Vista asks me if I want to merge the folders or cancel. How do I get the old XP behavior where the old folder is just replaced.


This issue is especially challenging when moving many folders at once and some of them move but then some of them hit this merge/cancel problem.


Thanks!



Answer



Windows XP doesn't replace a folder of the same name when you attempt to copy over it. It merges. It replaces any existing files of the same name and copies any new files from the source to the target.


Perhaps you are trying to ask how to prevent the constant prompts to overwrite files and folders? In XP, you were presented with the "Yes to All" button:


Yes to All


In Vista, there are check boxes at the bottom of the prompt dialogs to prevent it from asking you again:


Vista prompt to overwrite file


Saturday, 29 December 2018

linux - How do I auto mount a USB drive that all users can write to?


I'm trying to set up a Raspberry Pi to run BitTorrent Sync to back up my files to an external hard drive, but I'm running into some frustrating issues.


First, I need to set up the USB hard drive to auto-mount on boot, because the power frequently goes out where I live. So, I added a line to /etc/fstab


/dev/sda1   /media/josiah    vfat    defaults   0   0

I rebooted, and it mounted the drive, but then btsync couldn't write to it. So, I did a little reading and found that you have to specify the user option, so I tried this;


/dev/sda1   /media/josiah    vfat    defaults,user   0   0

That didn't seem to work either, so I tried specifying all of the defaults manually


/dev/sda1   /media/josiah    vfat    rw,auto,user,async,suid,dev,exec    0   0

I thought it was working, but then btsync started complaining again that it couldn't write to the drive, and when I tried to unmount it as a normal user it said that only a super user can unmount the drive.


That's confusing to me, since I thought that's what the user option was for. What am I missing, or doing wrong?



Answer



You can do a chmod after you mounted the partition, but that wouldn't be persistent accross reboots.


You should try this fstab line:


/dev/sda1   /media/josiah    vfat    user,umask=0000   0   0

Or this mount options:


mount -t vfat -ouser,umask=0000 /dev/sda1 /media/josiah

That will make the mounted partition world readable and writable.


If you need a less permissive setup, you should create a new group and mount as follows:


mount -t vfat -ouser,gid=1010,umask=0007 /dev/sda1 /media/josiah

It assumes your new group's gid is 1010. All users that need access to the mountpoint will need to be added to the new group.


linux - With Bash variables, what is the difference between $myvar and "$myvar"? (Specific odd behavior)


General Question:


In Bash, I know that using the variable myvar can be done in two ways:


# Define a variable:
bash$ myvar="two words"

# Method one to dereference:
bash$ echo $myvar
two words

# Method two to dereference:
bash$ echo "$myvar"
two words

In the case above, the behavior is identical. This is because of how echo works. In other Unix utilities, whether the words are grouped together with double-quotes will make a huge difference:


bash$ myfile="Cool Song.mp3"
bash$ rm "$myfile" # Deletes "Cool Song.mp3".
bash$ rm $myfile # Tries to delete "Cool" and "Song.mp3".

I am wondering what the deeper significance of this difference is. Most importantly, how can I view exactly what will be passed to the command, so that I can see if it is quoted properly?


Specific Odd Example:


I will just write the code with the observed behavior:


bash$ mydate="--date=format:\"%Y-%m-%d T%H\""
bash$ git log "$mydate" # This works great.
bash$ git log $mydate
fatal: ambiguous argument 'T%H"': unknown revision or path not in the working tree.

Why do I need the double-quotes? What exactly is git-log seeing after the variable is dereferenced without double-quotes?


But now see this:


bash$ nospace="--date=format:\"%Y-%m-%d\""
bash$ git log $nospace # Now THIS works great.
bash$ git log "$nospace" # This kind of works, here is a snippet:

# From git-log output:
Date: "2018-04-12"

Yuck, why does the printed output have double-quotes in it now? It looks like if double-quotes are unnecessary, they do not get stripped, they are interpreted as literal quote characters if and only if they were not necessary.


What is Git being passed as arguments? I wish I knew how to find out.


To make matters more complex, I wrote a Python script using argparse that just prints all of the arguments (as Bash interpreted them, so with double-quote literals where Bash thinks they are part of the argument, and with words grouped or not grouped as Bash sees fit), and the Python argparse script behaves very rationally. Sadly, I think argparse may be silently fixing a known problem with Bash and thus obscuring the messed up stuff that Bash is passing to it. That's just a guess, I have no idea. Maybe git-log is secretly screwing up what Bash is passing to it.


Or maybe I just don't know what is going on at all.


Thanks.


Edited Edit: Let me say this now, before there are any answers: I know that I can maybe use single quotes around the whole thing and then not escape the double-quotes. This actually does work somewhat better for my initial problem using git-log, but I tested it in some other contexts and it is just about equally unpredictable and unreliable. Something weird is afoot with quoting inside variables. I'm not even going to post all the weird things that happened with single quotes.


Edit 2 - This also doesn't work: I just had this wonderful idea, but it doesn't work at all:


bash$ mydate="--date=format:%Y-%m-%d\ T%H"
bash$ git log "$mydate"

# Git log output has this:
Date: 2018-04-12\ T23

So it doesn't have quotes wrapping it, but it has a literal backslash character in the date string. Also, git log $mydate with no quotes errors out, with the backslash-space in the variable.



Answer



Different approach:


When you run git log --format="foo bar", those quotes aren't interpreted by git – they're removed by the shell (and protect the quoted text from splitting). This results in a single arg:



  • --format=foo bar


However, when unquoted variables are expanded, the results go through word-splitting, but not through unquoting. So if your variable contains --format="foo bar", it is expanded into these args:



  • --format="foo

  • bar"


This can be verified using:




  • printf '%s\n' $variable


...as well as any simple script which prints its received arguments.




  • #!/usr/bin/env perl
    for $i (0..$#ARGV) {
    print ($i+1)." = ".$ARGV[$i]."\n";
    }


  • #!/usr/bin/env python3
    import sys
    for i, arg in enumerate(sys.argv):
    print(i, "=", arg)


If you always have bash available, the preferred workaround is to use array variables:


myvar=( --format="foo bar" )

With this, the usual parsing is done during assignment, not during expansion. You use this syntax to expand the variable's contents, each element getting its own arg:


git log "${myvar[@]}"

How do I separate a comma-separated list into two columns in Excel?

I have a long, comma-separated list which looks like this in Excel:


401.50,0.027  
402.00,0.028
402.50,0.029
403.00,0.031
403.50,0.032
404.00,0.034
404.50,0.037

Is there a simple way to convert this into two separate columns? There are over 800 values, and I am really not looking forward to separating them all individually.

boot - Installing Debian on my macbook air

I want to install Debian on my macbook air 13" from 2011. I'm following this tutorial: https://wiki.debian.org/MacBookAir4%2C2Testimonial


It starts by telling me to use bootcamp on OS X. I don't have OS X anymore, I'm using windows 8.1 on my macbook. I have 2 partitions: Bootcamp (C) and HD (D). I want to install it in the second partition (HD), but only in a piece of it. Then, I want to put the rest of HD together with Bootcamp, to form a greater partition.


So, this is the idea:


Bootcamp: 64Gb HD: 64Gb


I want to use 28Gb from HD to Debian and merge the another 28Gb with Bootcamp to form a partition with 100Gb.


First of all, can I just do it using the disk management tool from microsoft? I would Shrink the size of HD, to create a new partition. Then the idea was to install Debian in the new partition and merge the rest together. Is this easy to do?


The tutorial has this step:



I installed gdisk [1] and added a linux partition out of the free space, not creating any file system.



So I can't use the disk management tool from microsoft? How do I create a partition with gdisk? Is it before or after shrinking the volume of HD?



I also made sure the latest firmware update (2.2 at the time) and OS X update (10.7.2 at the time) were applied, which they were from the factory.



I think my firmware is 2.2, but I don't have OS X anymore. How do I verify it?



I also made sure the latest firmware update (2.2 at the time) and OS X update (10.7.2 at the time) were applied, which they were from the factory.



I don't have OS X, so I don't have this 'dd', I think. Can I just use a normal program to create a bootable pen drive?



I also prepared a second usb stick for firmware from [3], but in the end it did not work automatically (because of using double usb sticks?) and I copied the firmware in place manually. The files needed are brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw from the package firmware-brcm80211_0.28+squeeze1_all.deb



how will I extract the files from firmware-brcm80211_0.28+squeeze1_all.deb?


Also, what is this "GRUB installation", and where do I install it?

windows - End Process vs End Process Tree

What is the primary difference between the two? I always see this in the right click menu in windows. What happens if you end a process that is relied upon by another process? Is there a way to "kill" a process tree in linux or is the technology different?

security - How do I detect keystroke loggers in a reliable way?


I've always had a problem typing my passwords in on computers I don't trust (think non-technical friends computers) and although I can usually avoid doing it, there are times when I still need to use them. My main concern is having my passwords stolen by a keystroke logger.


So my question is - is there a reliable way to detect keystroke loggers?


I know of hardware keystroke loggers like KeyGhost but I'm mostly interested in software based ones.



Answer



Following the change of emphasis of the title of the question to "How do I detect keystroke loggers in a reliable way?" much of my answer below is irrelevant. In short, I do not believe you can detect keystroke loggers in a reliable way. There are some ways to detect some of them, some countermeasures to limit their effectiveness and some ways to bypass them, and I discussed some of these in the rather dated answer below, but there is no reliable way to detect them. Have a read at the Wikipedia article on keylogging methods and countermeasures.


Not an easy problem.


Software keylogging


Bypassing software that picks up keycodes as keys are pressed and released can be done by using on-screen keyboards or cut and paste from screen-based data but that will not work with software working at lower levels (at some point the operating system has to feed the "simulated keypresses" to the application waiting for input).


The risk can be further reduced by using an operating system that is less likely to be a target for keylogging software attacks.


If this really matters and the hardware is clear of logging devices then booting a read-only copy of a known clean operating system (e.g. a checksummed live CD or DVD) is worth considering if the hardware/network owner permits this and the CD/DVD contains the applications you need and you know the setup parameters needed (passwords and data could be on an encrypted USB stick mounted, in a Unix-like system, to not allow file execution). Using your own hardware/software, following good security practices and rebuilding regularly from clean, trusted, checksummed media is another way forward.


The suggested mechanisms aim to reduce the risk of having keylogging software on the system. If a keylogger gets onto a system then a strong firewall policy may detect a keylogger attempting to send data back to its 'owner' over the network but that often assumes an onerous manual involvement in the firewall process (e.g. tuning the system to allow specific applications to use specific IP ports and addresses). Finally, as well as a keylogger on the system, some of what has been typed in may be visible if the data is transmitted over a network or the physical integrity of the filesystem is compromised. How these can be mitigated is beyond the scope of this question but must be included when considering application and system integrity. However, monitoring the network can show whether sensitive data is normally transmitted and also help to identify unexpected transmissions.


One-time passwords, changing passwords quickly if they might have been compromised, the use of keylogging software detectors (software that scans the PC looking for the signature of known keylogging software) are also amongst the possible countermeasures but all countermeasures have weaknesses.


Hardware and other keylogging


Whilst outside the immediate scope of your question these needs to be borne in mind. They include observation of network flows, devices connected between the keyboard and the PC, over-the-shoulder snooping, video cameras, acoustic or electromagnetic or vibration monitoring (e.g. see TEMPEST measures) or examination of RAM contents for information, if someone is interested enough in what you might be typing. Detection of these ranges from easy to impossible.


General


There is a helpful article on Wikipedia on keylogging methods and countermeasures that is well worth reading.


networking - What is "Switching Bandwidth"?


I am trying to decipher exactly what is meant by switching bandwidth on tech specs for various switches. I think I understand, but I'm not so sure.


I know that a port on a 10/100/1000 switch can operate at 1Gbps in each direction at the same time in full duplex mode. So that means that each port can have a theoretical bandwidth of 2Gbps. If a 24 port switch has an advertised "switching bandwidth" of 48Gbps (such as this Netgear), is that just normal? Because Cisco seems to be making things confusing with their marketing, eg here.


Does switching bandwidth scale linearly with the number of ports available? I've seen some models with 4-8 ports with much lower figures for switching bandwidth.



Answer



In short, I would assume it describes at what speed the switch itself can route data between the ports.


If you have a 24 port switch with 48Gbps switching bandwidth, great! Every port can operate at full capacity at all times.


If you have a 24 port switch with 24Gbps switching bandwidth, not as great. Only half of the ports can operate at full capacity or all of them at half capacity (or something in between).


I would assume the second group is the cheaper group ;)


networking - Windows network bridge not working for guests


I recently bought a second Ethernet interface for my Windows 10 machine (TP-Link TG-3269 in particular, the first interface is the one built into my BIOSTAR TZ77B motherboard) in hopes of making a network bridge as follows (all Ethernet cables):


Router <=> Interface 1 <=> Interface 2 <=> Switch/other guests


Note that I'm not doing Router <=> Switch <=> Interface 1/other guests because Router <=> Interface 1 is gigabit, which I want to keep, while the switch is megabit.


I'm assuming that the network bridge makes the host act as a switch, i.e. DHCP, etc. managed by the router coming through Interface 1 should still be accessible to other guests via Interface 2. However, after following many guides and setting up the network bridge, the host works just fine (with a static IP) but all the guests I've tried can't communicate past Interface 2. For example, on an OS X guest, ifconfig shows the following (no IPv4 address):


en5: flags=8863 mtu 1500
options=b
ether 00:00:ba:60:05:3e
inet6 fe80::877:a12:183c:eec3%en5 prefixlen 64 secured scopeid 0x4
nd6 options=201
media: autoselect (1000baseT )
status: active

Monitoring the guest's network interface with Wireshark, I only see a ridiculous amount of packets arriving from Interface 2, but they're all low-level. Every once in a while there are packets of other types but none of them result in the guest getting an IP address, let alone connect to the Internet. Something similar happens to a Raspberry Pi guest.


What am I missing? Following this answer, I have already enabled promiscuous mode on both interfaces, but it hasn't changed anything. I haven't really tried Internet Connection Sharing but I would prefer to leave all my devices under the same network, and I think ICS creates a different network by default.



Answer



The solution seemed to be manually installing the drivers for Interface 2, the ones Windows 10 had automatically installed weren't working properly. I installed mine from the installation CD, but as of writing they can also be downloaded here.


apache http server - How do I install ffmpeg on Windows 7


I'm using Windows 7 and Zend server for my PHP.I have fed up completely searching and trying every methods of installation found on internet.


Luckily, I installed it well on my Ubuntu machine at my home.


How do I install ffmpeg in Windows 7?



Answer



I came across this tutorial, which is a good starting guide. Here you can get the latest builds.


This page lists more guides.


Also have a look at the K-Lite Codec Pack.


In general, videohelp.com is a good resource for setting up video stuff.


macos - How to make wireshark show http protocol instead of 802.11?


I recorded the wlan traffic in my network and saved this as a pcap file. Now I'd like to see the recorded http traffic and filter for some parts of the http traffic.


I can open the pcap file in wireshark and it shows what you can see in the attached screenshot , but I don't find a way to see ip addresses or http messages. If I filter for http I get an empy list.


How can I make wireshark showing me the captured http traffic?


enter image description here



Answer



type http into the filter box hit enter


enter image description here


firefox quantum - Media opened in a background tab will not play until the tab is selected


This feature was introduced with Firefox 56:


http://mozilla.org/firefox/56.0/releasenotes


However I do not like it. Oftentimes I will middle-click a YouTube song link with the intention that it will open in a background tab and start playing, meanwhile I can continue with whatever I am doing in the current tab.


How can I reverse this new behavior?



Answer



Using the browser console:


Services.prefs.setBoolPref('media.block-autoplay-until-in-foreground', false);

http://wiki.mozilla.org/Firefox/Block_autoplay


How can I tell Vim to show ANSI escape codes properly?


I'm trying to view and edit a file in Vim, but this file has ANSI escape codes:


^[[1m[0.05s elapsed, 00:00:13 total]^[[0m

How can I tell Vim to interpret them properly instead of just showing the raw code?



Answer



It sounds like you want to display ANSI colors and conceal their escape characters. You can do this with Charles Campbell's "AnsiEsc" plugin.


Note that you will need Vim version 7.3 or newer. (Older versions of Vim could be patched, but that's more work for an outdated version of Vim.)


What is a safe download link for Windows XP Service Pack 3?



Is this still available from MS? If not can someone suggest a reliable 3rd party site that does not bundle adware/malware into the download?



Answer



Service Pack 2 and Service Pack 3 are available from Microsoft here: http://catalog.update.microsoft.com/v7/


You must use Internet Explorer 6 or later.


Search for "XP Service Pack" (without quotes)


Unable to set permissions using Cygwin on Windows 7

I have Cygwin 1.7.34(0.285/5/3) installed on a 64-bit Windows 7 machine and I've found that I'm unable to control the permissions of files/directories on my computer with it (through chmod). Most files/folders appear to have permissions fixed at -rw-r--r--.


This is a problem for me as incorrect permissions of the ~/.ssh directory on my workstation might be what's ultimately causing a related issue I have with establishing password-less ssh connections with a server.


This is what my ~/.ssh permissions look like currently:


$ ls -la .ssh/
total 30
drwxr-xr-x 1 davidfallah Domain Users 0 Mar 19 08:21 .
drwxr-xr-x 1 davidfallah Domain Users 0 Mar 18 15:17 ..
-rw-r--r-- 1 davidfallah Domain Users 405 Mar 18 17:26 authorized_keys
-rw-r--r-- 1 davidfallah Domain Users 1675 Mar 18 18:00 gitolite-admin
-rw-r--r-- 1 davidfallah Domain Users 405 Mar 18 18:00 gitolite-admin.pub
-rw-r--r-- 1 davidfallah Domain Users 672 Mar 18 17:27 id_dsa
-rw-r--r-- 1 davidfallah Domain Users 613 Mar 18 17:27 id_dsa.pub
-rw-r--r-- 1 davidfallah Domain Users 1675 Mar 18 17:26 id_rsa
-rw-r--r-- 1 davidfallah Domain Users 405 Mar 18 17:26 id_rsa.pub
-rw-r--r-- 1 davidfallah Domain Users 512 Mar 18 16:16 known_hosts

Based on similar questions I've looked at, I tried running chown -v :Users .ssh/* in case that did anything, and I get the following:


$ chown -v :Users .ssh/*
changed ownership of ‘.ssh/authorized_keys’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/gitolite-admin’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/gitolite-admin.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_dsa’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_dsa.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_rsa’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_rsa.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/known_hosts’ from davidfallah:Domain Users to :Users

However, this exact output repeats itself every time, suggesting it's not actually making any changes. Similarly, trying to run chmod -v 777 ssh/* (as an example permission config) consistently produces the following output:


$ chmod -v 777 .ssh/*
mode of ‘.ssh/authorized_keys’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/gitolite-admin’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/gitolite-admin.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_dsa’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_dsa.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_rsa’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_rsa.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/known_hosts’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)

This behaviour is the same whether or not I run the Cygwin64 terminal as a regular user or as an administrator.


If it's relevant, my /etc/fstab file is:


# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0

I also get the following information from df -T:


$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
C: ntfs 488282108 184977440 303304668 38% /cygdrive/c
D: ntfs 488383484 7224840 481158644 2% /cygdrive/d
E: ntfs 488374972 115013864 373361108 24% /cygdrive/e
U: ntfs 102403916 94741644 946740 100% /cygdrive/u
W: ntfs 585869308 187598724 398270584 33% /cygdrive/w
X: ntfs 29604476 16650464 12954012 57% /cygdrive/x

Friday, 28 December 2018

windows - How to create a new volume with free space

I tried googling it but I couldn't find any answers so I thought I'll ask it here.
I've got a harddrive with a lot of free space and 1 primary partition but every time I click new simple volume and set a size for the volume which is below the size of the free space it says: There is not enough space available on the disk(s) to complete the operation.
Any idea why?

Printer driver for windows 7

I just installed windows 7 ultimate, but i cannot get my HP 3015 Laserjet all in one to work. Are there any drivers available, the driver given on the HP website does not work. Please, help.

how to dual boot fedora 18 and windows 8?

i just bought a new DELL Inspiron 15R laptop which comes with pre installed windows 8 64 bit. I got no cd or dvd for windows 8. i want to dual boot my laptop with fedora 18. Can anyone point me towards a step by step installation process. i am a total novice and i badly need Fedora. I read online that there were some technical hitches regarding dual booting with windows 8. I dont want to downgrade to windows 7. Please help.

How do I get Windows 8.1 to enable Recycle Bin on a removable drive?

I want to use Recycle Bin functionality on my removable USB Sandisk flash drive. i.e. I want to be able to retrieve my file after an accidental delete. A related question exists (How do I get Windows 7 to NOT use the recycling Bin on a removable drive?) but I want to do the opposite.


My drive is a 16GB Sandisk flash formatted NTFS. It is marked as removable. Cannot find a way to enable Recycle bin on it.

display - How do I decrease the brightness of my screen below the minimum on Windows 8?


The minimum brightness on my desktop monitor is far too bright. I need a way to reduce the brightness of my screen below the minimum. On my Mac, the app Brightness Slider worked perfectly for this purpose.


Based on the answer to this question, I tried using Dimmer, but it doesn't work properly in Windows 8. Sometimes it just dims the desktop, or the active window, and doesn't dim anything else. The result is a partially bright screen which looks totally weird.


If it matters, I really need this kind of app. If there is no such app available, is it possible that I could code it by myself, somehow? :-|



Answer



f.lux has a hidden feature which allows you to decrease your screen's brightness below the minimum set by Windows.


You can use alt+pgdn to decrease brightness and alt+pgup to increase brightness.


Note: This is not the same as adjusting screen temperature, which f.lux is also able to do.


Dimming screen with f.lux


windows - How to disable the middle button scrolling in Chrome


When I press middle mouse button, it opens:


alt text


It is so difficult to control the scrolling. Is there any way to disable this?



Answer



There's now an extension for this:


https://chrome.google.com/webstore/detail/no-smooth-scrolling/oikddacoldignalphkgeppnpalkmkgbo


Earlier versions of Chrome required restarting the browser for this extension to take effect, but that appears to no longer be the case.


macos - How to use exact path in Mac OS X open file dialog?

How do I to use the exact path in the Mac OS X open file dialog?


/Users/username/Workspaces/Enide-2015/_ws/atom.ico

I have found this answer, but there are still few extra clicks. There is also this answer, but I still have to click in filter that is *.gif by default.

microsoft excel - Selecting the date of every Monday and Wednesday from a date range

I need a formula or a macro to help automate a grade sheet's dates.


We have class every Monday or Wednesday only. I would like to vlookup from an input table of each quarter's date range, for example, Sept. 10 - Oct 24. The code should auto-insert the date of every Monday and Wednesday in a row at the top of my grade sheet.


Every year I use the same Excel workbook I built to average and rate the grading with no problem, however I can't seem to get this one right. Currently I have to enter each date by hand.

windows - Pinging *.5 and replies from *.4


This may belong on SF, migrate if it does!


Pinging 192.168.1.5 with 32 bytes of data:
Reply from 192.168.1.4: Destination host unreachable.
Reply from 192.168.1.4: Destination host unreachable.
Reply from 192.168.1.4: Destination host unreachable.
Reply from 192.168.1.4: Destination host unreachable.

Pinging a windows machine on my home network with the IP 192.168.1.5, Windows is trying to get replies from 192.168.1.4. The machine I am pinging has an automatically obtained IP and it can access the internet fine. The machine I'm pinging from is able to ping any other machine on the network just fine.


I've never encountered anything like this before.


Can anyone shed some light? Why would this be happening?


Things I haven't tried yet:



  • Rebooting router

  • Rebooting my machine

  • Rebooting target machine (or renewing target IP)


Edit: Pinging any "unassigned" IP on the network will try to get replies from my own IP (192.168.1.1 will try to get replies from my own IP) - thanks to regan's answer for pointing me that way. I'm 100% sure this machine is connected to the same network and there is no firewall active.



Answer



To shed some light:



  • When you can't ping the IP of a machine, your own IP says it is unreachable.


Things to try:



  1. Try the things you haven't tried yet to clean out possible clutter in an easy way.

  2. Try to ping the target machine from another machine to see if the target machine is the problem, if the other machine succeeds them the problem is more likely on your machine than on the target machine.

  3. In the case that the target machine is the problem, you might want to run the following command as an administrator to enable pings: netsh firewall set icmpsetting all enable

  4. If the case that your machine is the problem then it is a weird case, for some reason it doesn't see the target machine but still sees the other machines, but that is a case that normally isn't so common.


Please let us know if this helped or if you have more details. For more information and other possible less general causes, see this on Google: "Destination Unreachable" site:microsoft.com


windows xp - Make WinXP believe that there is a second monitor? (ATI Radeon Mobility 9000)

See the screenshot below. It shows the Windows display properties in German. I can configure a second display, although I have not connected one. So far, so good. Only it does not work: When I click on OK, then the screen flashes, but nothing changes, and the option "Windows-Desktop auf diesen Monitor erweitern" ("Extend my Windows desktop onto this monitor.") is unticked.


How do I make Windows believe that there is a second monitor? (ATI Radeon Mobility 9000)


Why I want to do this? I want to access the second screen via VNC from another computer.


Windows display properties in German

Thursday, 27 December 2018

webserver - How do I check the checksum of a download and why should I?


My memory isn't great but I think five or six years ago, when I downloaded some package, there was never a checksum line under the download icon on the webpage. And no instructions to "check the checksum" to make sure your download is correct. Now these things are everywhere. I have two questions about them (whether MD5 or whatever).




  1. When did they start becomeing so popular and why are they used? I mean, if I'm downloading a package from server X, then it is up to the server to make sure it is giving me the correct package (I think, anyway).




  2. How do you check the checksum? Usually I download the package and install it immediately. Maybe this is stupid.





Answer




When did they start becomeing so popular and why are they used?



I can't tell you when, but they are used for at least two good reasons.


1. File integrity


When downloading a huge binary file, you can't make sure there is not a single bit error during transmission. This could be due to various reasons, from the server sending the file to your computer saving it on the drive. You can't assume that every transmission is error-free.


If you use this file to install something on your computer, it might propagate this single error up until the point where a program crashes for no obvious reason.


Another common scenario would be: You download an ISO file to burn it to a DVD and install Linux. During setup, the installer notices that there is a broken file on the disk. This could be due to a single bit error that occured during the download.


2. Your own security


If you know the supposed checksum of a file, and you download another file that doesn't match this checksum, you either have a file with errors (see above), or somebody wants to trick you.


Imagine the download site of a famous software distributor being hijacked. Although this might not happen all to often, consider it a security concern.





How do you check the checksum?



Depends on the checksum method used. MD5 and SHA checksums can easily be checked on any *nix system using the md5 or sha1sum commands. On Windows there is a File Checksum Integrity Verifier.



Usually I download the package and install it immediately. Maybe this is stupid.



You can download and install it anyway. Normally, an installer should check whether the data contained is error-free and completed. You can try to remove single bytes from an executable installer using a Hex editor and see if it still completes. I hardly doubt so.


Summarizing, it's not necessary to verify checksums (I've never done it), but it doesn't hurt if you have the time.


task scheduler - How to make a scheduled window-creating program not steal the focus?


I have written a small console program that checks that all my websites are up and running properly. I use the Microsoft Windows Task Scheduler to run this program automatically once a day.


Screenshot


The problem is that, quite naturally, the program steals focus every time it runs. I would prefer if it would start without becoming the top-most window on my desktop. What is the simplest way to achieve this? Of course, I could rewrite my EXE to create a background window (or no window at all), but it would be nice if the Task Scheduler had an option like "Do not steal focus" or something, but maybe that is not even possible...



Answer



You could have Task Scheduler run a vbscript that opens your console program. The vbscript can use the Shell Run method to open it minimized with something like:


Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad.exe", 6, true

There is some basic info about this at http://ss64.com/vb/run.html


is there a tool which enhances the windows open/save file dialog to allow adding comments (descript.ion file)

i am looking for a program/tool which allows to change the windows open/save dialog to allow adding comments which are then saved into a descript.ion file


enter image description here


example description file:


tumblr.jpg description for this file
"Server Error.png" another description
"We'll be back shortly.png" 3rd desc
monster.jpeg one more

windows 10 - How to copy and paste file with the "Remote Desktop" app?


There are two RDP clients for Windows 10:



  • the old Remote Desktop Connection client (built-in)

  • the newer Remote Desktop client (windows store).


While I have no trouble to copy and paste files around with the old client, I cannot manage to do the same thing with the newer client. How do I copy and paste files between machines with the Remote Desktop app?



Answer



I've tested this myself and it doesn't work here either.


According to Microsoft here, it's not possible. You can copy-paste text between sessions, but not files. Their proposed solution is using the old application, Microsoft Remote Desktop Connection.


mac - Usage of Dual Ethernet Jacks (One for LAN, One for WAN)


I'm working on an old Mac PowerPC G5 that has two Ethernet jacks. I'm interested in finding a way to have both jacks setup so that all internal traffic (all traffic to and from a specific IP address range. E.g., 192.168.*) to be routed through one of the jacks, and the other jack to route all other traffic.


It sounds doable, but I'm not sure how to approach this situation. Any help would be much appreciated.


EDIT


Thank you for the quick responses. I'm sorry for not being clear, I'm using OS X Tiger and I am not trying to share my internet connection.


My router provides two connections to my Mac (i.e., providing two internal IP address to my computer, e.g., jack #1 192.168.1.100 & jack #2 192.168.1.101)


Let's say I want to connect to a VPN on jack #2, but keep access to local resources on jack #1. (i.e, jack #1 192.168.1.100 & jack #2 VPN assigned 10.246.10.100)


In this example, I would want all internal traffic (to and from 192.168.*) to be routed through jack #1 and all other traffic routed through jack #2.


I hope this clears up my situation more.



Answer



This can definitely be done using the route command. I wish I could offer exact advice on how to use it but I haven't used it in 14 years. it should be something like this


Set the default route to the first ethernet (assuming eth0) using the GUI, then:


route add -net 192.168.0.0 netmask 255.255.0.0 dev eth1

This assumes that eth1 is where the vpn traffic will go (I think)


To view the routes that you have set up use netstat -rn


This can get quite complicated very quickly. You might get a better answer if you ask at serverfault.com on how to use the route command.


If you really want to learn how to do this, it would be covered in TCP/IP Illustrated, Volume 1: The Protocols which is an excellent, very technical book.


How do I mount an NFS share in Windows 8?


I have a NAS that I'd like to mount over NFS. It works great on my Mac, but I cannot figure out how to mount this device on Windows 8.


I've searched a bit online, but all the articles seem to apply to Windows 7 and involve the mount command which doesn't seem to be part of Windows 8. What's the command to do this?



Answer



To connect to an NFS share, you need to make sure you have the NFS client installed. This component is a part of the Services for Unix component. Go into the control panel, Programs and Features, then Turn Windows features on or off. Make sure Services for Unix-based Applications (DEPRECATED) is checked, and click OK. Be advised that typically only Ultimate and Enterprise versions of Windows typically have this component available.


This will install the MS NFS client and (AFAIK) the mount command. I'm not at work so I can't verify exactly. If I remember I'll update Monday.


If your NAS can enable CIFS or SAMBA style shares, I would use that instead.


Wednesday, 26 December 2018

What is the best way to fix a stuck pixel on an LCD screen?


I have an LCD screen with a pixel that is stuck ON (that is, bright). What do you suggest to fix it (it's not a dead pixel)?



Answer



Software Method



  1. Try running pixel-fixing software. Stuck pixels can often be re-energized by rapidly turning them on and off.


JScreenFix – A website that randomly turns on and off each pixel at up to 60 times a second to fix stuck pixels.


DPT 2.20 – A Windows application to help locate and identify dead/stuck pixels. It also has a pixel exerciser built in to possibly get lazy pixels working again.


UDPixel 2.1 – A free Windows application which help you to locate and fix 1 or more stuck pixels.


LCD Scrub – An US$18 Mac-only screensaver that flashes various patterns on the screen to fix burn-in


If this fails, complete the following steps.


Pressure Method



  1. Turn off your computer's monitor.

  2. Get yourself a damp washcloth, so that you don't scratch your screen.

  3. Take a household pen, pencil, screwdriver, or some other sort of instrument with a focused, but relatively dull, point. A very good tool would be a PDA stylus.

  4. Fold the washcloth to make sure you don't accidentally puncture it and scratch the screen.

  5. Apply pressure through the folded washcloth with the instrument to exactly where the stuck pixel is. Try not to put pressure anywhere else, as this may make more stuck pixels.

  6. While applying pressure, turn on your computer and screen.

  7. Remove pressure and the stuck pixel should be gone. This works as the liquid in the liquid crystal has not spread into each little pixel. This liquid is used with the backlight on your monitor, allowing different amounts of light through, which creates the different colors.


Tapping Method



  1. Turn on the computer and LCD screen.

  2. Display a black image, which will show the stuck pixel very clearly against the background. (It is very important that you are showing a black image and not just a blank signal, as you need the backlighting of the LCD to be illuminating the back of the panel).

  3. Find a pen with a rounded end. A Sharpie marker with the cap on should be fine for this.

  4. Use the rounded end of the pen to gently tap where the stuck pixel is - not too hard to start with, just enough to see a quick white glow under the point of contact. If you didn't see a white glow, then you didn't tap hard enough, so use just slightly more pressure this time.

  5. Start tapping gently. Increase the pressure on the taps gradually for 5-10 taps until the pixel rights itself.

  6. Display a white image (an empty text document, or sending your browser to about:blank and going to fullscreen with F11 is good for this) to verify that you haven't accidentally caused more damage than you fixed.


Heat Method


This method is useful if large areas are discolored or even black. It works best with laptops, but it may work with separate monitors, too. By using this method, you are exposing your computer to the risk of damaging the processor and/or other components by overheating. If you do this, you should be willing to accept the loss of your computer (for laptops), or monitor (for stand-alone screens). You should backup your data before trying this method. In particularly bad cases of damage, the effect may not work completely, or the fix may not be permanent.



  1. Turn on the computer.

  2. Make sure it is plugged into wall power.

  3. Go to your power settings in the control panel and set the computer not to go to sleep or standby mode.

  4. Place the laptop in a partially-closed desk drawer or somewhere that is not well-ventilated.

  5. Close the laptop lid almost completely, but don't let it close fully - This will keep the laptop screen turned on indefinitely. You may take a small paper pamphlet or something soft and place it on the keyboard to prevent gravity from closing the lid.

  6. Let the computer sit for several hours or even days in this condition. You may check on it as frequently as you like. The heat generated will cause the liquid crystal to flow more easily into the areas that were not formerly filled.


Tips:


If the pressure and tapping don't work directly on the stuck pixel, start moving outward around the stuck pixel. If you see the pixel flicker while doing this then you know where you can focus the pressure and tapping techniques rather than directly on the pixel.


Many people report success with this technique, but these instructions won't work in every case. It may take a few attempts to make sure you are pressing exactly on the stuck pixel. These instructions will fix "stuck" pixels, not "dead" ones. Dead pixels appear black while stuck pixels can be one constant color like red, blue or green. An alternative, but similar technique involves gently massaging the stuck pixel with a warm damp (not wet) soft cloth.


Alternative technique to tapping: Using a rounded pencil eraser, push with moderate pressure into screen at stuck pixel.


If these instructions don't work, you can hopefully get the monitor replaced through your manufacturer. If your monitor falls under the specifications of replacement, get in contact with the manufacturer to set up replacement plans.


Warnings:


Do not attempt to open the monitor as it will void the warranty and the manufacturer will not replace it.


Make sure you don't get any electrical equipment wet or it may break.


Some people claim that touching the screen can cause more pixels to become stuck, although this has not been proven.


LCD displays are composed of multiple layers. Each layer is separated by very small glass spacers. These spacers and the individual layers are very delicate. Rubbing an LCD panel with a finger or even a cloth can cause the spacers to break and cause further issues beyond the original pixel fault. As such, most repair technicians with service certifications are trained not to use the rub or tap methods - use them at your own risk.


Most LCD manufacturer warranties for LCD displays will cover replacement of the panel when the display reaches a certain number of pixel anomalies. These warranties, however, generally will not cover damage caused by rubbing the screen so use extreme caution and contact the manufacturer before proceeding to see if you qualify for repair or replacement.


Article provided by wikiHow, a wiki building the world's largest, highest quality how-to manual. Please edit this article and find author credits at the original wikiHow article on How to Fix a Stuck Pixel on an LCD Monitor. Content on wikiHow can be shared under a Creative Commons License.


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