Friday 30 November 2018

macos - How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5.


When I try to run my shell script from my AppleScript, I get the following error message:


Error message at AppleScript Script Editor
error "sh: /Users/path/to/file/myShellScript.sh: Permission denied" number 126

myShellScript.sh
cd /Users/myusername/Git/myproject/
git remote remove origin

myAppleScript.applescript
do shell script "/Users/path/to/file/myShellScript.sh"

What am I doing wrong?

windows 8 - Change DOCX icon

I have a small (aesthetic) problem with my MS Word documents. After uninstalling a slew of programs (I don't remember them all) explorer no longer displays the correct icon on DOCX files (though it does for DOC files). Under the Type field in explorer the files are listed as "DOCX File"s, which, while technically accurate, is normally displayed as "Microsoft Word 2010 document." Also, the context menu no longer shows the "Open, Edit, New, Print" entries. I was able to get the documents to open in Word but am still having these aesthetic issues. I ran the fix as described here, and that fixed it for the office programs other than Word. I have also tried uninstalling and re-installing the entire office suite, but that also didn't work. Any help would be appreciated.

jumplist - Force Windows 7 to pin a file with no extension to the Jump List for Notepad


I want to add the "C:\Windows\System32\drivers\etc\hosts" file to the Jump List for notepad.exe on a Windows 7 machine, but since the file does not have an extension there is no default program associated with it. This means it never shows up in the recent list and you also cannot drag it to the task bar to manually pin it to the start list. I've had problems with jump lists before, and there are ways to use the Registry or File system to change how Jump Lists work, but I haven't seen anything to manually edit a jump list yet. Is there any way to force an item to be pinned to the jump list when that item does not have a program associated with it?



Answer



OK I did a little playing.


If you give your user write access to the HOSTS file (dangerous if malware runs as you) you can then create a hardlink to the file (as admin) using a .txt extension that you can edit.


Open a cmd prompt as Administrator and use FSUtil to make a hardlink in a folder you have full access to (like your desktop):


fsutil hardlink create C:\Users\%USERNAME%\Desktop\PinnableHosts.txt C:\Windows\System32\drivers\etc\hosts.

You can then open "PinnableHosts.txt" in Notepad and when you edit it, the changes will be reflected in your HOSTS file (and vise versa, since they're linked).


It will (should) then be in the 'recent list' for Notepad, and therefore available to be pinned.


HTH.


usb - Whats H9DA4GH2GJBM chip used for?

I have been investigating counterfeit devices and how they work. I noticed that this one USB device claimed to have 8GB doesnt seem to be telling the truth as it corrupts around 200mb, I opened the usb to investigate and i found this Chip (seems like a storage chip) And i need help what does it do.


enter image description here Photo here

windows 7 - Random GPU output glitches, possible dying GPU?

On random occasion, the image on my screen will become extremely distorted for no reason- and in some cases these glitches can be reversed simply via changing the monitor configuration from 2 monitors to 1 monitor and back, or to the extreme of having to reboot the computer, interrupting my work in a serious way. Luckily, these errors rarely occur, but i cannot have my GPU gradually get worse to the point where it doesn't function to my needs.


Situation 1 Screen configuration


The monitor the above glitch is being viewed on is a Benq Widescreen monitor (no idea what the resolution is / can't recall). The shot above was taken earlier today, but i experienced this error earlier over summer too, and before that time, soon after i installed Windows 7 onto this computer for the first time (mid last august I screwed up the operating system a bit and re-installed it, and with that, reinstalled the drivers for my GPU). I'd also like to note that the left part of the affected monitor has somewhat of a line pattern on it (image below) The application currently on screen is the League Of Legends client This also happened with the monitor I was previously using, which was square like my secondary monitor. I Will also note that this does not effect my second monitor. The only solution that I can find to this problem is essentially shutting down the computer in some way, be it either by sleeping the rig or actually shutting it down and turning it back on. The computer operates completely as it normally should save for the screen glitch when this is occurring, and It doesn't crash any applications when it happens.


Situation 2 enter image description here These random stripes are pretty much the same as the last situation- save for what the problem is. The shot above was actually taken last july, before i reinstalled windows. This glitch actually crashed the instance of photoshop that I had open at the time, but thinking back on it, the graphical error could have been caused by photoshop crashing in the first place. Again, the glitch here could only be resolved via reboot. Not much else to say on the matter. (Pardon my camera's Phone's flash >_<)


Situation 3 (wasn't able to capture this error...) A couple nights ago I opened up a right-click menu, selected a menu item, and continued as usual- BUT, the selected item kinda stayed on my screen where I selected it. Any GUI elements behind it still work, and this lingering menu selection seems to be non-effective to the computer. Truth be told, this could have been from the computer being on for a long duration, and I HAVE experienced it on other computers before in the past (the other two errors occurred when the computer hadn't been on for much longer than 1 hour- hardly a duration of time in which it could overheat or anything). The remedy for this situation I found was simply switching the monitor config and then back, but as soon as I open up another drop down menu and select an item on it, the error occurs once again. I have seen this lingering GUI Element glitch with other things, too- Toasts, Tooltips, Etc.


Computer Specs: -Dual Intel Xeon 3.2GHz 8 Cores each -XFX Radeon HD 6870 1GB 900MHz -4GB -2TB 7800 RPM HDD


I Am using an AMD GPU, Yes, and I do know that their products are not quite as high quality as NVidia products, but my current GPU has been serving me very well for the year or so I have had it, and I sure did pay for the quality. Its an XFX card, too, and to those who are not familiar with the brand, they are one of the best hardware developers on the market.


EDIT~ adding the information @psychogeek asked me to put on here.


The left monitor i am currently using is set at 1680 by 1050, and the right monitor is set at 1280 by 1024. The one on the right is actually plugged into the Monitor 1 Port on my GPU, meaning that the left monitor would be plugged into the 2nd port. Both are using DVI as their connection type. The left (second) monitor is set to be the main display, with the right (first) monitor extending from the other one. I am not using Eyefinity in this configuration, despite being able to.


All of the 5 fans in my computer are operating fully and always have been, since the purchase of this computer. I am quite sure cooling/overheating is not a problem here.


Edit 2~ added a bit of information that may be useful for some of you.


None of these situations could be captured via the screen capturing tool. The first one was able to capture the desktop, but captured it just as the desktop would normally be displayed without the glitch. The Second situation also couldn't be captured. The third situation captured the desktop normally as it would without the lingering GUI elements- they seemed to overlay everything when they occurred, I suppose including the screen capture selections.

How can I disable laptop keyboard but not wireless keyboard? (Windows 7)

I am using Windows 7 on an Acer Aspire 5755G laptop. How can I disable my laptop keyboard without disabling the wireless external keyboard?


(I guess I am looking for the Windows 7 equivalent of this AskUbuntu question.)

windows - My Pinned List In Excel Is Gone

My pinned files from Excel are gone I have tried to go here: APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations But I have no idea what to do there. Can someone please help me get them back. If I right click start and then go to Properties then the start menu tab, the correct boxes ARE checked.

networking - Maximum/ ideal length of ethernet cable?


What is the maximum and/or ideal length of an ethernet cable? Is there a distance that data cannot be transferred over an ethernet cable, say over X number of feet?



Answer



There is no ideal length of a cat 5 cable but the specification states that it should not be more than 100m (328 feet).


More info on the wiki page


The specification of 328 feet has to do entirely with collision detection in a CSMA/CD (Carrier Sense Multi Access / Collision Detection network. Basically, the length is limited by the fact that the shortest possible frame size (64 bytes) can be sent out on the wire and if a collision occurs, the sending node will still be sending that frame when it hears the collision (due to a jam signal or higher than normal amplitude). If a collision occurs during the first 64 bytes of a frame, this is a normal collision. If something is out of spec such as the cabling is too long and the collision occurs after the first 64 bytes, this is a late collision and will not be retransmitted until an upper layer of the OSI model detects that the packet did not make it to its destination. You can run longer cabling and the network will still function, but there will be issues.


windows 7 - Turn off the HDD when not in use


I have a SSD which I have my OS on and some other important programs on and a regular HDD with games/movies and stuff. Just wondering if I could turn of the HDD somehow when I don't use it? They're both connected with SATA.



Answer



Control Panel -> Power Options -> Change advanced power settings -> Hard Disk -> Turn off hard disk after -> (some number of minutes)


linux - mysql (mariadb) ERROR 1698 (28000): Access denied for user 'root'@'localhost'


I'm working on Xubuntu 15.04. I already installed the MariaDB-Server on various systems and was always asked for a root password during installation. This time, however, I don't remember being asked for the password. When I try to login without a password (or a blank password), I get the Access denied for user 'root'@'localhost' error. I tried uninstalling the package completely by


sudo apt-get remove mariadb-server
sudo apt-get purge mariadb-server

When I reinstalled, I still didn't get asked for the root password.


I tried the mysqld --skip-grant-tables approach from mysql how to fix Access denied for user 'root'@'localhost' . I can modify the password for the root user in the mysql database - at least the hash value changes - but I still cannot login with the new password after a restart of the mysql-server. I still get the same error.


The user debian-sys-maint does not exist. So, I cannot use it to fix anything.


Any ideas what else I could try?



Answer



I solved the problem following the answer from this post:


Can't reset MySQL (MariaDB) root password


One has to change the plugin field of mysql.user for all roots to a blank string.


Cisco VPN Client - External URL are tracked?


I'm using a Cisco VPN client to connect to a local server of my society. Do they track all the URLs I visit when connected to the VPN Client? If I go for example on bbc.com, is it recorded in my log (if there's any)?


Thanks.



Answer



Based on our discussion, you seem exclusively concerned about local logging from the cisco VPN client, monitoring connections that are not using the VPN.


Cisco does not log IP connection information, except that which pertains to the VPN connection itself, like establishment, maintenance, and disconnection. See here for examples of the logs the VPN client uses: https://supportforums.cisco.com/blog/150666/software-vpn-client-logging-common-issues


The statistics you are seeing, are simple interface connection statistics, based on the standard windows interface statistics.


In terms of remote side logging, and bypass, The VPN client intercepts all traffic the host wants to send onto the network, and performs a route lookup on the IP, to determine how to handle it. If split tunneling is disabled, the default gateway for the interface is set to send all traffic to the VPN host network, but if it is enabled, the default gateway remains as it was, sending all traffic to unknown networks out the normal LAN interface, and out your internet connection. That means that other than the Client itself, no other equipment is able to log the URL. if you disable split tunneling and send your internet traffic onto the VPN LAN, at which point, equipment on that LAN might choose to log your connections.


security - Could local ISP capture my location whenever i launch a VPN to a VPN server?

I am extremely concerned that my ISP collects any information once I am connected to a VPN server. For instance, as far as I know, when I start a connection to a HotSpotShield VPN server, an IP address is assigned to me just before a successful connection. Besides, I'll be having an extra IP address at the beginning with the TAP Adapter. An encryption tunnel is set up between me and the VPN server. Whenever my request for a website reaches them (VPN server), they decrypt the data and later they encrypt the reply which returns from the web (targeted) server. This works like that. So, the ISP can not see what I am watching, displaying and writing because the connection is encrypted. But, the targeted websites see and record all actions. Still, they can not identify my real IP address.


I'm really concerned about if the ISP can see "my location". OK, it has an IP address from another country as my real IP address, but how does my ISP detect the traffic going through them? Can they find out who I am? Won't they say "Hey, there is a traffic but who is and what he is doing right now?", because I get the Internet from them?

Using Git to Manage An iTunes Library?


I've been considering using Git to manage my iTunes library and allow me to sync it between computers.


Can you think of any reasons why this would be a bad idea?



Answer



The main drawback is disk space. The repository itself will take the same amount of space as the set of "checked-out" files. This means when you clone the repository your collection will basically take twice as much disk space.


Worse still, even if you delete files you no longer want, there will still be copies in your repository, taking up space.


You might want to look at synchronisation tools like unison which is designed for two-way synchronisation of files across multiple machines.


windows - A specified logon session does not exist. It may already have been terminated for non cyg_server users on Cygwin

Some more progress:


This is working for any account on which the services is started with. That is if we give credentials of a particular account in Log On tab of a service. Then it works for that account and so on. This is the same case with Windows Remote Management. But everything works fine over RDP.


Some progress


I have installed SSHD service with a user with admin privileges cyg_server. When I login over ssh to this account. Credential manager is working fine. But when I login with other users, it wouldn't.


Original Question


I also observed any programs saving keys to windows credential manager are giving me A specified logon session does not exist. It may already have been terminated. error. (Only when running via ssh)


Although there are some pointers towards the issue on the internet. I was not able to exactly find the root issue.


Edit: Additional Information


The program that I wrote is ultimately calling CredWriteW function from win api.


Could you help?

windows - How to type zero-width space character (U+200B) on a laptop keyboard?


There is a very similar question to this one already (How can I type U+200B character?) but all the answers are about how to type this character on a PC keyboard with a num pad which is not my case.


I use Czech (QWERTY) layout but am willing to switch to English (US) layout if necessary.


How do I type this character (U+200B) on a laptop keyboard without a num pad?


Edit: I want to do this on Windows, without a Fn key if possible. If the process of "typing" it involves MS Word, copy/paste from some website or anything else that is easily doable on a standard Windows laptop, I'm fine with that too.



Answer



You could just use the Character Map program, built into Windows. It lists all characters for each font installed on the system, and lets you select one and copy it to the clipboard. In fact, I use it to reference all the keycodes to type them, otherwise, but when I'm on my laptop, it's handy just to be able to copy the characters from that program.


It's available in the Accessories start group, or by running charmap.exe.


You can copy U+200B like so:


charmap


memory - Why not use SSD space as RAM?


I am new to the hardware side of things. I run a few machines which have 400GB+ SSD's and 32GB RAM. I have been thinking about going up to 64GB RAM, however, I was thinking, since SSD's are solid-state like RAM, can't my extra space be used as RAM?


If I do this, will the extra RAM (from disk space) be significantly less efficient than DDR3 RAM?



Answer



Two years after the question was posed, the answer is changing from no to maybe.


Samsung SM951 is the current state of the art and, in RAID 0, has been shown in testing to achieve 4.5GB/s read and 3GB/s write. At a cost of $1/GB per disk this is significantly cheaper than RAM.


http://www.legitreviews.com/samsung-sm951-m2-pcie-ssds-raid0-performance_161753/5


DDR4 data transfer rate:
DDR4 2133:17 GB/s
DDR4 2400:19.2 GB/s
DDR4 2666:21.3 GB/s
DDR4 3200:25.6 GB/s

http://www.transcend-info.com/Support/FAQ-292


Further, the short lifespans of SSDs have been greatly exaggerated with tests showing that the 250GB Samsung 840 Pro sustains 2.4PB of writes.


http://techreport.com/review/27909/the-ssd-endurance-experiment-theyre-all-dead/4


Depends on the application. If speed is more important than space then RAM, otherwise (maybe) look at SSD.


Thursday 29 November 2018

windows vista - convert multiple segments of DVD to FLV


I have a DVD of footage that I need to convert to FLV.


I would rather not convert the whole disk as I only need specific segments. Is there a program that I can input start and end times and to get multiple files of these segments?


Can you also advise on the best settings to use for best quality at the smallest file sizes.


I'm working on a Vista 64bit machine.


Thanks. Josh



Answer



The latest release of VLC lets you interactively record segments.


VLC can also transcode videos. You could chain the two operations together if you knew the segment start and stop times. You can use these same commands to write out the segments non-interactively without transcoding.


I'm not certain VLC can transcode into flv - you'll need to check that if you intend to use VLC to convert the stream too.


Make Windows Task Scheduler alert me on fail


I have an automated script that pulls backups from my website to my local computer. This script could fail; once my server was down, another time I accidentally moved my script.


How do I make Windows Task Scheduler tell me with the script fails (or doesn't run/not found)?


I don't care if a prompt comes up, an email or something that appears on my desktop. I want to be notified if something goes wrong. On my server, crontab emails me about errors - which is great. I want something like that on my windows 7 local computer.



Answer



When a scheduled task fails to start, an event is written to the TaskScheduler event log:


Note: The Task Scheduler log is located at (under Administrative Tools)


 Computer Management
System Tools
Event Viewer
Application and Services Logs
Microsoft
Windows
Task Scheduler
Operational

enter image description here


Windows lets you trigger scheduled tasks to start when a variety of events happen, e.g.:



  • time of day

  • system startup

  • user login

  • event recorded in event log


Armed with this knowledge, you can create a scheduled task that that runs when your scheduled task fails:


enter image description here


This scheduled task's action can then be set to something that sends you an alert - in your choice of methods (e.g. triggers a shutdown). You might just want it to send an e-mail:


enter image description here


This is how Windows handles everything. You can see many diagnostic tasks that trigger on an event appearing in the log. e.g. when an IP address conflict is detected, an event is written to the log:



  • Log: System

  • Source: Tcpip

  • Event ID: 4198


A scheduled task triggers on this event, and runs a program to tell you about it and to fix it. Keep in mind that the event id is not specific to just one task. Any task that generates the event 203 - Action failed to start, will trigger this task.


command line - How to copy 12 random jpgs to a folder and rename by batch or powershell fast (Windows 10 Spotlight Related)


In the search for a final solution to randomizing the login screens as part of an answer for Keep Windows 10 lock screen spotlight pictures but turn off all texts hints/balloons, I am seeking help, I am still very new to the world of batch, though think it will be a useful solution when finished.


Now extending this question to power shell as per discussion with @KeithMiller



Windows batch file or powershell file that can:



  • Copy 12 random jpg images and rename to new location

  • No duplicates

  • Actually be random

  • To run fast in just a few seconds even if choosing from 700 to 1500 files.

  • To search for .jpg

  • .Jpg file names to be unknown, so any files can be selected or added to the folder.

  • Rename the 12 images to new location half as .jpg half as .png: img100.jpg, img101.jpg, img102.jpg, img103.jpg, img104.jpg, img105.jpg and also img100.png, img101.png, img102.png, img103.png, img104.png, img105.png


Note: Windows 10 will still uses the jpgs as png even though they are renamed. With this solution there will be up to 12 random background user lock screen, and also, as far as I have tested this allows for the 5 cache images under lock screen settings.





Powershell Copies 12 images to new location randomly (.PS1)
$d = gci "C:\Test\A\*.jpg" | resolve-path  |  get-random -count 12
Copy-Item $d -destination C:\Test\B

from Stack Exchange, already works with no duplicates, now only need to find out to seperate out the paths in order to rename. Possible code found that may help:


foreach ($file in $sourcefiles)
{
$newdir = $file.DirectoryName.Replace( $sourcepath, $destination )

If (-not (test-path $newdir))
{
md $newdir
}

Copy-Item -Path $file.FullName -Destination $newdir


}

from Microsoft Technet




Batch code to count files, then produce 12 random numbers.
@for /f %%G in ('2^>nul dir "C:\test\A\*.jpg" /a-d/b/-o/-p/s^|find /v /c ""') do set N=%%G

@echo Total files: %N%

@echo off & setlocal EnableDelayedExpansion

for /L %%a in (1 1 12) do (
call:rand 1 %N%
echo !RAND_NUM!
)

goto:EOF

REM The script ends at the above goto:EOF. The following are functions.

REM rand()
REM Input: %1 is min, %2 is max.
REM Output: RAND_NUM is set to a random number from min through max.
:rand
SET /A RAND_NUM=%RANDOM% * (%2 - %1 + 1) / 32768 + %1
goto:EOF

Counting JPG and Giving Random Number



  • This does not account for duplicates, though I thought it would be a good way to quickly count images and come up with a number to select.


this is based on post here and here




The prior solution that I have was made for this was thanks to @DavidPostill

This solution works for about 150 images, then unfortunately runs for to long. I made an error, apologies, and did not know that windows 10 slideshow randomizes the images on its own.


I have really tried my best to research the topic, though coding is still beyond me, so any help would be greatly appreciated. I have included reading/research below...




Reading and Research:


Answer



This should be close to what you want:


$SelectCount = 12
$SourcePath = "C:\test\A\*.jpg"
$DestPath = 'C:\test\Renamed'

If (!(test-path $DestPath)) {md $DestPath | out-null}

$files = Get-ChildItem -path $SourcePath -file -recurse | Get-Random -count $SelectCount
for ($i = 0; $i -lt $files.count; $i += 2) {
copy-item $files[$i] -destination ('{0}\file{1:000}.jpg' -f $DestPath, ($i/2+100)) -whatif
copy-item $files[$i+1] -destination ('{0}\file{1:000}.png' -f $DestPath, ($i/2+100)) -whatif
}

Remove the -whatif parameters from the copy-item statements if you want them to actually execute.


Keith


Can the number of suggestions in firefox's location bar be increased?


Example : you start typing the address in firefox's location bar, it gives out, uhmm, 6 suggestions. Can that number be increased (also, can it give only the title, without the actual address to save space) ?



Answer



The maximum number of results returned can be changed with the browser.urlbar.maxRichResults config option. The size and format of the actual box can be changed by modifying the browser chrome, but I'm not sure what needs to be changed.


windows - Is a .lnk file a symbolic link or a junction?


A .lnk file (created via the create shortcut context menu in Windows Explorer) a symbolic link or a junction?



Answer



It is neither. Links and junctions are features of the file system, built into NTFS.


A .lnk is a feature of the "shell" - the desktop gui part of Windows. Effectively it is just a file that contains reference to another file (they can also point to any path that the shell knows how to open, including various URLs, or even pathless shell objects such as Computer or Control Panel folders or items contained there, or programs that aren't actually installed but "advertised" via Windows Installer).


It is the gui part of Windows that dereferences the link and opens the right file, whereas with a symbolic link or junction this is done by NTFS.


windows 7 - Create a Symbolic link to the merged contents of 3 folders

I have 3 folders with large amount of data in each which has to be maintained seperately. Can I create a sym link or shortcut.in windows which should show me the merged contents of the 3 folders. I am not looking for library conf in Win7.


Any suggestion is highly appreciated.

firefox - Understanding CSS for user styling in a browser


I want to make a specific change to the appearance of a specific site in my web browser. This site uses CSS, so I think what I should do is write a user CSS override (please correct me if this is wrong).


My browsers are Firefox (for which I think I should write something in chrome/userContent.css) and Chrome (User\ StyleSheets/Custom.css).


The specific change I want to make is to remove the background pattern (dark dots) on all pages of https://unix.stackexchange.com/ . But more generally, please teach me how to fish: how do I find out what parameter to change, and how do I write this change in a user css?



Answer



I can only speak with familiarity with Firefox, as that's my main browser. I'll try to keep things general here to fulfill your 'teach me to fish' request. To that end, I'll include 2 examples, yours and another that has more real-world lessons in it. First, we'll get some tools to make user CSS creation easier.



  1. Update to the latest Firefox. Some of the recent versions have had expansions of the web site inspector tools, so you'll want those.

  2. Optional: Install the Firebug extension which gives you much more powerful site inspector tools. (personally, I don't use Firebug for making user CSS, but I include a mention here for completeness sake)

  3. Install the Stylish extension. This is a user CSS-centric extension that greatly simplifies the creation of user CSS.


Now then, to actually write something. You should have a basic familiarity with HTML and CSS before proceeding. W3Schools has decent tutorials available to familiarize yourself with the basic structure and syntax of HTML and CSS. For the sake of this answer, I'll include enough information to hopefully help a newbie along enough to get the example accomplished.



  1. Navigate to the page. (in your case, https://unix.stackexchange.com/)

  2. Right click on the element you're looking to manipulate. (pretty much anywhere on the page for this case, as the background affects the whole page)

  3. Select 'Inspect Element' from the pop-up menu. This uses Firefox's integrated inspection tools, I won't address Firebug here, but it has similar panes and features.

  4. This opens up panels on the bottom and side of the Firefox window. On the bottom, you're seeing HTML. On the right, you're seeing CSS rules for the selected page element (which will be the thing you right-clicked on). On the bottom, click around on different elements to navigate around. The page is organized into a tree of elements, and you can collapse or expand each node in the tree. As you click on elements, the selected element will be highlighted on the page itself.

  5. In general, at this point, you'll want to inspect the element you're looking to manipulate, along with its parent elements (the items that contain that element in the tree). Identify the element that you'll actually have to manipulate. For example, if you're messing with the answers on this page, you'd end up starting with the

    element that contains the text of an answer, but you want to include all the stuff around the text, like the up/down vote arrows, the poster's information, the share/edit/flag links, etc. So you navigate up a couple of levels to the

    tag that has an id of "answer-####" and a class of "answer", as that is the element that contains all the window-dressing elements of an answer. Click on it, and you'll see that part of the webpage get highlighted. (In this instance, the background of the page will be near the top, within the tag. Scroll up to the top of the HTML, and click the tag.)

  6. Next, you need to identify the CSS properties of this element that you'll want to manipulate. Look at the CSS on the right, and find the properties you want to alter. Personally, I'm pretty new to CSS, so at this point, I will often google 'css' + a property name to learn more about the property and how it behaves. Continuing my example where we're looking at a SE answer, let's say we want to alter the margins around the answer. The all.css file has a margin property set to 0px, but clearly there's a margin around these elements. Some googling teaches me to look for padding properties, as those can also affect the margins around an item. Sure enough, there are two properties related to padding that are set on an answer, padding-bottom and padding-top. (for your specific issue, you're looking for a background image, so look for 'background' in CSS properties. You'll see a 'background' property near the top. It applies to the body elements of that page. Googling "css background property" to learn how that property works, shows you that it can contain a color or an URL to an image, along with various modifiers. After navigating a bit to dig down to how the background-image property works, we see some useful information, the default value of 'none'. We want to revert the background image to its default value, so we'll need that information.)


  7. Now we use Stylish. The alternative without Stylish would be to edit the files you posted in your answer. Stylish enables us to easily manage many sites' user CSS. Stylish adds a little icon to your Firefox window, click on it then go "Write a new style"->"For "(this site).com". Give the style a Name and optionally some tags. You'll then be able to distinguish this style as being the one that applies to Superuser.com or Stackexchange.com etc. This window gives us a template that lets us alter the CSS just for this domain. If you need to alter the CSS for a specific URL, you can do that or you could also just get a blank style if you wanted to write CSS that applies to all sites, simply select the appropriate entry from the Stylish menu. For my Answer-modifying example, you'd get a text box that contains this:


    @namespace url(http://www.w3.org/1999/xhtml);

    @-moz-document domain("superuser.com") {

    }

    Anything put into the @-moz-document block will apply only to the domain there in the parenthesis. See the bolded items above. To alter the padding for the answers, you update the text box to be like this:


    @namespace url(http://www.w3.org/1999/xhtml);

    @-moz-document domain("superuser.com") {
    .answer {
    padding-bottom:0px;
    padding-top:0px;
    }
    }

    To break this down for people who don't know CSS, we're first selecting the class (ergo a "." goes at the start. If we were selecting by ID, we'd put a "#" there.) answer (so 'answer'). Then we open a block with a curly brace to list out the properties of the selected item we'll be altering. First we are altering padding-bottom and setting it to 0 pixels. Then we do the same for padding-top. Each property and value is ended with a semi-colon. Then we close the block with a curly brace. (in your unix example, you would do this:


    @namespace url(http://www.w3.org/1999/xhtml);

    @-moz-document domain("unix.stackexchange.com") {
    body {
    background:none;
    }
    }

    Here you're working on the unix.stackexchange.com domain. We're selecting the "body" element (when selecting HTML element is also a CSS selector, no need for #s or .s here). We're setting the background to none.)



  8. I draw your attention to the buttons at the bottom of the Stylish style-editing window. "Preview" will enact the changes you typed in, so you can see them in action. "Save" will save the changes. "Cancel" is pretty obvious. For pretty much any user CSS changing you're doing, you'll want to click Preview to see if the change worked the way you wanted it to. In both examples, you'll see that it didn't work. There's an important reason for this, which I now address.


  9. CSS has a specific hierarchy of priorities for determining how to deal with user CSS vs. author CSS vs. browser CSS. Normally, we have CSS for a page that's written by the author of the page, and that will contain rules for many of the elements on that page. When a rule isn't defined by the author, but is in your user CSS, then your browser will use that. If neither of them have CSS defined for that element, then the browser uses its own default CSS rules on that element. So there's a hierarchy of weight here, author > user > browser. If something is defined in all three, then the higher-weight CSS will win out and have its CSS take effect. There's a way to get lower-weight CSS to override the higher-weight CSS, and that's by designating them important. You do this by including "!important" in each CSS declaration, like so:


    @namespace url(http://www.w3.org/1999/xhtml);

    @-moz-document domain("unix.stackexchange.com") {
    body {
    background:none !important;
    }
    }

    Now click Preview again, and you'll see that your user CSS works. Click Save and enjoy.




If you're using Chrome, its built-in inspector is already very good. There is also a Stylish extension. You enter the CSS modifications a bit differently: select “Manage installed styles” then click “Write new style”, enter the sites or URL patterns to apply the post to below the code box, and enter only the domain-specific CSS in the “code” box, e.g.


body {
background:none !important;
}

Converting video from 1080p to 720p with smallest quality loss using ffmpeg


I stack with my high quality movie: 1080p with 60fps. The trouble is lags while playing.


I tried to convert it to 720p with ffmpeg:


ffmpeg -i MyMovie.mkv -r 60 -s hd720 MyMovie_720p.mkv

But I there is significant quality loss because bit rate decreased from 32.3 Mbps to 2.8 Mbps. How can I specify right bit rate for video stream, and left all other stream copied pristine?


Input file mediainfo:


ID                                       : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.2
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 2h 58mn
Bit rate : 32.3 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.260
Stream size : 40.2 GiB (92%)
Writing library : x264 core 116 r2019 9cc407d
Encoding settings : cabac=1 / ref=4 / deblock=1:-2:-1 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / psy_rd=0.80:0.20 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=6 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=6 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=0 / crf=14.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=50000 / vbv_bufsize=62500 / crf_max=0.0 / nal_hrd=none / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:0.60
Language : English
Default : Yes
Forced : No
Matrix coefficients

: BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177

Answer



Here is an example which should give you the highest quality video (I'm not speaking about the resulting file size). Note that this video might not be playable on all devices or players:


ffmpeg -i MyMovie.mkv -vf scale=-1:720 -c:v libx264 -crf 0 -preset veryslow -c:a copy MyMovie_720p.mkv

To get a "visually lossless" quality, you can use:


ffmpeg -i MyMovie.mkv -vf scale=-1:720 -c:v libx264 -crf 18 -preset veryslow -c:a copy MyMovie_720p.mkv

Now let's see what we have here:


The scale video filter is for resizing the video. You just set one size – which is the height in this example – and use -1 for the other dimension. ffmpeg will recalculate the correct value automatically while preserving the aspect ratio.


Quality controlled with the -crf option:



The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn't technically lossless.


The range is exponential, so increasing the CRF value +6 is roughly half the bitrate while -6 is roughly twice the bitrate. General usage is to choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value and if it looks bad then choose a lower value.



You can find more info in the x264 encoding guide.


You control the tradeoff between video encoding speed and compression efficiency with the -preset options. Those are ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. Default is medium. The veryslow option offers the best compression efficiency (resulting in a smaller file size for the same quality) but it is very slow – as the name says.


The audio will be stream copied directly from the input file to the output file without any changes.


unix - Printing pages from 7 to 17 by lpr


How can you print pages from 7 to 17 by lpr?



Answer



lpr -P myprinter -o page-ranges=7-17

where myprinter is the name of your printer


Reference for all "about"/"chrome" address bar strings for Firefox and Chrome


It there a reference for all the magic strings which one can type on Google Chrome and Firefox?


For instance I forgot how to create/show profiles in Chrome beta. I later found that it was about:flags. I am sure I can find more magic strings if I were to sift through code or plough through documentation.


But any reference here would be appreciated.



Answer



Google Chrome


In Google Chrome, it's either of these:



  • about:about

  • chrome://chrome-urls


The page will list all possible pages. In Chrome, all about: pages are internally treated as Chrome URLs, with the chrome:// protocol handler. Therefore, these are equivalent.


chrome://accessibility
chrome://appcache-internals
chrome://apps
chrome://blob-internals
chrome://bookmarks
chrome://cache
chrome://chrome
chrome://chrome-urls
chrome://components
chrome://copresence
chrome://crashes
chrome://credits
chrome://device-log
chrome://devices
chrome://dns
chrome://downloads
chrome://extensions
chrome://flags
chrome://flash
chrome://gcm-internals
chrome://gpu
chrome://help
chrome://histograms
chrome://history
chrome://indexeddb-internals
chrome://inspect
chrome://invalidations
chrome://linux-proxy-config
chrome://local-state
chrome://media-internals
chrome://memory
chrome://memory-internals
chrome://nacl
chrome://net-internals
chrome://newtab
chrome://omnibox
chrome://password-manager-internals
chrome://plugins
chrome://policy
chrome://predictors
chrome://print
chrome://profiler
chrome://quota-internals
chrome://sandbox
chrome://serviceworker-internals
chrome://settings
chrome://signin-internals
chrome://suggestions
chrome://sync-internals
chrome://system
chrome://terms
chrome://thumbnails
chrome://tracing
chrome://translate-internals
chrome://user-actions
chrome://version
chrome://view-http-cache
chrome://voicesearch
chrome://webrtc-internals
chrome://webrtc-logs

The following URLs are sectioned off because they cause something "bad" to happen:


chrome://badcastcrash
chrome://crash
chrome://crashdump
chrome://kill
chrome://hang
chrome://shorthang
chrome://gpuclean
chrome://gpucrash
chrome://gpuhang
chrome://ppapiflashcrash
chrome://ppapiflashhang
chrome://quit/
chrome://restart/

Last Updated: Chrome 46


Mozilla Firefox


Mozilla Firefox has the same meta-page: about:about, but here's a list as well:


about:about
about:accounts
about:addons
about:app-manager
about:buildconfig
about:cache
about:config
about:crashes
about:credits
about:customizing
about:downloads
about:healthreport
about:home
about:license
about:logo
about:memory
about:mozilla
about:networking
about:newtab
about:performance
about:permissions
about:plugins
about:preferences
about:privatebrowsing
about:rights
about:robots
about:serviceworkers
about:sessionrestore
about:startpage
about:support
about:sync-log
about:sync-progress
about:sync-tabs
about:telemetry
about:webrtc
about:welcomeback

Last Updated: Firefox 40.0.3 canonical-1.0


Setting up Remote access home LAN behind multiple routers?

I split/share an internet connection with family members that live next door to my house. I don't have/need/want cable, so they have the modem. I have admin/config access to all components involved.


I have a NAS server on my end that I cannot figure out how to access from outside my LAN. My network components are arranged thusly:


Internet
|
|
V
[next door]
|
|
V
ISP Cable Modem
|
V
Router: D-Link DI-524
|
|
[my house]
|
|
V
Access Point: UBNT Nanostation (necessary for reliably strong WiFi signal from next door)
|
V
Router: Engenius ESR1221 (EXT)
|
V
NAS: Synology ds210j

It took me forever just to configure an internet connection to my house through all of those components, I'm maxing out my knowledge-level here.


I've worked on accessing the NAS, off & on, for months with no luck. I've tried accessing different components (file server, ftp, VPN server, etc.), with SSL / without SSL, I've forwarded ports, DMZ'd inner router, DMZ'd the NAS, setup a dynDNS account. All in such a disorderly fashion that some combination thereof may be the answer & I danced around it.


At any rate, I'm looking for an explanation of the networking concepts to do this (if one exists) that ignores what I've tried so far & focuses on the components involved.

linux - schroot Don't Share Home Directory


I created a schroot recently (following the directions here), and it conveniently shares my (host) user home directory. That is, /home/username is the same in the chroot as outside the chroot.


Where is this behaviour configured ? How can I prevent this behaviour ?


I'm using Ubuntu desktop 12.04 64-bit, and schroot version info is


$ schroot --version
schroot (Debian sbuild) 1.4.25 (03 Feb 2012)

Answer



By default, schroot mount directories according to filesystem table file /etc/schroot/default/fstab. You could comment the line start with /home so that schroot won't bind-mount the home directory.


You could also specify other filesystem table file by editing schroot conf file. For example, if you add setup.fstab=minimal/fstab to the end of /etc/schroot/chrood.d/[your chroot's].conf, schroot would filesystem according to /etc/schroot/minimal/fstab.


printing - How can I visualize the file system usage on Windows?

How can I visualize which folders and files are taking up all of the space on my hard drive?


I'm getting some conflicting reports on the size of hard drive contents. Namely what is and isn't there and what folders are actually using the space.


I need to know which of the files or folders the culprits behind all this hidden bloat. Also there should be a print option to get it on paper.

Wednesday 28 November 2018

How to turn off Outlook Notifications?


I like email to stay an asynchronous system as it was designed. Whenever I receive an outlook email notification, I get out of my work flow and become unproductive, "event-driven"...


How do I turn the notification in Outlook off? I'm using 2003...


P.S: I would opt for not using outlook at all but unfortunately at the company I work at, I have to use it...



Answer



I've only got access to Outlook 2007 but I believe the options are the same:


Tools > Options > E-mail Options > Advanced E-mail Options...


In this dialog there's a section headed "When new items arrive in my Inbox".


alt text


Clear them all.


I've no idea why these options are buried so deep within the UI - it's bad design.


How can I tell if I have Google Chrome 64-bit installed?


I think I just installed Chrome 64-bit, but I can't tell. About Google Chrome screen shows only Version 37.0.2062.94 m and I don't have anything in my 64-bit Program Files folder. Is there a way to tell if I am using 32-bit or 64-bit?



Answer



If you open task manager you should see (32 bit) beside the executeable name if it's 32 bit, and nothing if it's 64 bit.


How do you change Chrome's background color?



I've been looking for a way to dial down reddit's white background late at night. I ended up using Control Freak (which is very cool) with my own custom styles. It works perfectly.


Except when it loads a new page it still defaults to white for a couple seconds before loading my custom styles (which show up in "user agent stylesheet" in dev tools)


Is there any way to prevent the screen from flashing bright white, like it does, before the user agent stylesheet is loaded?



Answer



The below links to a plugin which helps to change the background colour as per user needs,hope this helps.


[link] https://chrome.google.com/webstore/detail/change-colors/jbmkekhehjedonbhoikhhkmlapalklgn


Once in after installing the plugin go to the plugin preferences and modify the colour you want as background.


Can I move the default documents folders location in Windows 10 using powershell or batch?

I want to create a simple script to move some of the default user folders (like Documents, Pictures, Downloads, etc.) to a different drive, but I can't figure out a way to do this with powershell or batch. Does anyone know if there's a way?

macos - Mac OS X using over 4 GB of memory with nothing running


My Mac seems to be using a ridiculous amount of memory when close to nothing is running. Immediately after restarting my computer, and only starting up a terminal and the activity monitor.


How could close to 5GB of RAM be being used when only two processes are running and memory use according to the “Activity Monitor” and htop is closer to 1GB? Any help or insight would be greatly appreciated.


htop displays this:


enter image description here


And the “Activity Monitor” displays this:


enter image description here



Answer



This is pretty easy to explain. Let’s look at a screenshot of “Activity Monitor” taken from my Mac OS X 10.9.5 system just now:


enter image description here


With that as a reference, let’s do some math based on the items on the lower right-hand side of that screenshot:



  • App Memory: 1.59GB

  • File Cache: 1.32GB

  • Wired Memory: 1.30GB


Add those numbers up and the total is: 4.21GB which exactly matches the value of Memory Used which is 4.21GB.


So what is the difference between app memory, file cache and wired memory? All of this is very clearly answered in Apple’s own support articles entitled, “Use Activity Monitor to read system memory and determine how much RAM is being used” which is for Mac OS X 10.8.5 and earlier or this article “How to use Activity Monitor” which is for Mac OS X 10.9 and higher. And here are the pertinent definitions from the later article since—based on your screenshots—that you are using Mac OS X 10.9 or higher:



  • App Memory: The total amount of memory currently used by apps and their processes.

  • File Cache: Memory that was recently used by applications and is available for use by other applications. For example, if you've been using Mail and then quit Mail, the RAM that Mail was using becomes part of the file cache, which then becomes available to other apps. If you open Mail again before its file cache memory is used (overwritten) by another app, Mail opens more quickly because its file cache is converted back to app memory instead of loading all of its contents from your startup drive.

  • Wired Memory: Memory that can’t be compressed or paged out to your startup drive, so it must stay in RAM. The memory used by a process can’t be borrowed by other processes. The amount of wired memory used by an app is determined by the app's programmer.


Now looking at those definitions, it seems like the biggest user of “inactive” RAM is actually the file cache RAM area. Since it is a cache, it can be overwritten/reallocated right away if needed by the system. But since it is indeed a cache, if you relaunch an application that previously used that cached memory, that application will start up faster.


So knowing that, you can safely assume that the 1.32GB of memory used by the file cache can really just be considered “free” memory since the system will just grab it and use it when it can. And—of course—it has the added benefit of speeding up the launch/use of past applications that have things saved to that file cache if they are launched or used again.


Also, note that running graph in the lower center of the “Activity Monitor” called “Memory Pressure.” As Apple describes it:



The Memory Pressure graph helps illustrate the availability of memory resources.



Which is all to say that the “Memory Pressure” graph is an attempt by Apple to help visualize the relative complexity of memory management on modern Mac OS X systems since—as you can see—deciphering memory usage by just staring at raw numbers can be confusing at times.


linux - ssh + here document – does Ctrl+C get to remote side?

As part of a series of tasks I have to do, I have to build a bash script that accesses a remote computer, executes 3 commands, waits for a process to end through a SIGINT (or simply end) and then do some cleanup afterwards.


Currently, I'm using this code:


#! /bin/bash

# local preparations
# ...

ssh -t $USER@remote.far <<-'COMMANDS'

echo "Preparing execution"

java -jar execute.jar &
executePID=$!

echo "Ready."
echo "CTRL+C to clean and close"

trap "kill $executePID" INT HUP
wait $executePID

#cleanup code here

echo "done. Logging out"
sleep 2
logout
COMMANDS

# Final local cleanup

This code seem to work just find until wait (builtin) command. wait seems to be consuming all commands that come after it and so, when I try to send a SIGINT (Ctrl+C), it seems to fail to execute the trap content and all the cleanup code.


How can I fix this so it works the way I expect?


I'm not allowed to split this bash file into multiple ones and I'm not allowed to create any scripts on the remote computer even if temporary.
Both computers are running the same flavor of Linux.

email - Outlook rule for a specific period date


In my Outlook 2013, I am trying to manage my emails by creating sub-folders in my inbox.


What I want to do is to divide my emails in four sub folders named as follow :


(First Quarter, Second Quarter, Third Quarter, Fourth Quarter)


Currently, I want to apply this for the First and Second Quarter of the year.


Is it possible to do this by creating a specific rule?


I don't mind to create a rule for each quarter if needed.



Answer



You can do this, but you'd need to update the rule every quater


When you create a new rule, there is the option in Step 1


received in a specific date span

That will allow you to chose the date range you want to work with. In step 2 you can then choose


move to the specified folder

As per your comments, I'd probably create the sub folder now, similar to


2016
Q3
Q4
2017
Q1
Q2
Q3
Q4
2018
Q1
Q2
Q3
Q4
2019
Q1
Q2
Q3
Q4

And then (using the example above) create the rules required! This way you won't have to think about it until 2020!!


High-pitched noise coming from computer

Computer is ~3 years old. For the last 2 years, on hot days only (28C (82F) or more) it makes a high-pitched, quite loud, and very annoying noise. This noise comes in short bursts (up to 3 seconds long) and the occurrence frequency is unpredictable.


I've recorded a sample: http://www.box.net/shared/lqd3zc0ja4


The noise doesn't seem to be related to any particular activity, i.e. it occurs when the computer is idle, with and without high I/O activity, with and without high CPU usage.


I'm also sure it's not the PSU, as I've changed it and it's still screeching.


EDIT: it's definitely not a digital beep, it's an analog whine.


There is no crashing or freezing or anything abnormal when it screeches like this but it's quite annoying during summer. I've read (here, here) that it can be some electronic component in the motherboard gone bad. Is there any way to find which one is it? (carefully listening doesn't work, I've tried!) Is it even worth it? Is there any way to be relatively sure it's the motherboard and not the CPU or RAM or something else?


EDIT: I've now installed SpeedFan to see what's the temperature threshold where it starts making noise. Will update on the next hot day :)

Advanced startup options appear in blank (windows 8.1)

enter image description here


As you can see in the picture It shows only the icons but not the text and this happen even if I navigate through each of the options


I hope you can help me


greetings

Why is Firefox's cache empty after an improper shutdown?


I often rely on Firefox's cache to reopen pages I've previously visited while offline and more quickly load webpages. However, when Firefox is improperly terminated (such as by a hard computer shutdown caused by a power failure), the cache becomes empty. Why? Does it become corrupt, or is there some other technical reason? This question is platform-agnostic.


I'm not asking for speculation or opinion here, but an objective reason for this behavior. If this is by design, I'd like to see relevant references to discussions by Firefox developers or comments in the source code.



Answer



If there was an improper shutdown then firefox has no way to know if it was an attack or a hijack attempt, so if the cache is flushed, any viruses dependant on the cache to complete the install after a shutdown are gone.


its a security/safety feature.


How to read Fireworks PNG multilayer files without Fireworks


I recieved a couple of Fireworks PNG files. Fireworks has a special format for saving several source images in layers in the png file.


How can I read these without having Fireworks installed?


(im working on a mac but with vmware so any suggestions whatever platform is appreciated)


EDIT: I'd prefer to get a set of copies out of of the layered png. And I prefer if the export be lossless



Answer



PNG files do not have layers, so Fireworks layers are stored in the private chunks of the PNG files in a proprietary format which is not PNG. I don't know of any program that can read them. You'll need to ask the owner of these photos to convert them to flattened png (mono-layer) or into another multi-layered format such as psd.


If that's not an option, my only advice is to download a trial version of Adobe Fireworks (registration required) to convert these photos.


mac - Excel: How to sum values in a column based on multiple criteria


I have a list of criteria in row 20, like this:


A20: "My Company, Inc."
B20: "Client Expenses"
C20: "Travel"

The data is below, like this:


B40: "Client Expenses"
C40: "My Company, Inc."
D40: "Travel"
I40: $100

B41: "Client Expenses"
C41: "Acme, Inc."
D41: "Travel"
I41: $200

B42: "Client Expenses"
C42: "My Company, Inc."
D42: "Food"
I42: $300

B43: "Client Expenses"
C43: "My Company, Inc."
D43: "Travel"
I43: $400

I want to sum all of column I, if the criteria in A,B,C: 20 matches the data in B,C,D: 40:43


In OpenOffice Calc, this works:


=SUMPRODUCT($C$40:$C$66=A27;$D$40:$D$66=C27;$B$40:$B$66=B27;$I$40:$I$66)

In Excel for Mac OS X, it gives me $0. Can someone help me either fix this, or comes up with a different method to do the same thing?



Answer



Wrap each argument in parenthesis and add two dashes preceding them. Here it is rewritten:


=SUMPRODUCT(--($C$40:$C$66=A27),--($D$40:$D$66=C27),--($B$40:$B$66=B27),$I$40:$I$66)

That should work.


screensaver - Windows spanning 2 monitors resize themselves onto 1 after screen saver is started (Win XP)

I have a dual monitor setup with an ATI Radeon HD 3450 driving 2 Dell 1907FPs in Extended mode. The video driver is ATI's 8.561-081201a1-073177C-Dell.


Onscreen, I have a couple of non-maximised windows that I resize to span the 2 monitors. When the screensaver (any screensaver) starts (or finishes, I'm not sure), the windows are automatically resized so that they fit on one of the monitors only.


Is there a way to stop this from happening?

google chrome - How can I find out which tab is playing music?

Part of the research I do online, with Google Chrome, requires me to go to several sites including those who, for some dumb reason, think it's alright to hide the music player.


If I want to listen to music I can play my own and I usually am listening to something else when a random site starts playing random looped songs.


So, how can I find out which tab is playing music, and eventually mute it?

Video drivers for VAIO on Windows 7


So, ive just installed Windows 7 on my Sony VAIO vgn-sz5xn.


Problem is that I cant find drivers for my graphics card - NVIDIA GeForce Go 7400 GPU


Tried latest driver found on http://www.nvidia.com/object/geforce_notebook_winvista_win7_64bit_179.48_beta.html


The following notebooks are not supported in this release: Sony VAIO notebooks (please contact the notebook OEM for driver support for these notebooks)


I checked at VAIO sites, but havent found anything about drivers for Windows 7.


Tried installing Vista drivers, but they complain that its wrong OS blablah.


o_O


any tips?



Answer



So after a bit of googling i found the answer.


Download the latest drivers from this page: http://www.laptopvideo2go.com/drivers


Be sure to get the modified INF file.


Tuesday 27 November 2018

Wireshark: Accessing USB Bus Interfaces without sudo

I am trying to monitor some USB traffic using Wireshark on Linux (Ubuntu). If I start Wireshark as my normal user without root privileges, the USB bus interfaces are not listed. If I sudo wireshark though, I do see the USB bus interfaces. This is perhaps best illustrated using the dumpcap command to list the available capture interfaces:


~$dumpcap -D


1. eth0
2. any (Pseudo-device that captures on all interfaces)
3. lo

versus


~$sudo dumpcap -D


1. eth0
2. usbmon1 (USB bus number 1)
3. usbmon2 (USB bus number 2)
4. usbmon3 (USB bus number 3)
5. usbmon4 (USB bus number 4)
6. usbmon5 (USB bus number 5)
7. usbmon6 (USB bus number 6)
8. usbmon7 (USB bus number 7)
9. usbmon8 (USB bus number 8)
10. any (Pseudo-device that captures on all interfaces)
11. lo

Is there a way I can configure Wireshark so that I don't have to run as root to get access to the usb bus interfaces? I've previously followed a guide to setup wireshark so that I don't have to run it as root to see the Ethernet interfaces, so I'm wondering whether it's simply a matter of changing permissions on some other executable to be able see USB interfaces without running as root...

networking - OpenVPN on local network


I have installed OpenVPN on a Raspberry PI (server: 192.168.0.2) and on my Ubuntu laptop (client: 192.168.0.3). Both machines are connected to the same wireless network and have their addresses assigned by DHCP from the wireless router at 192.168.0.1. However, when the VPN is started, I cannot access the Internet from the client.


When I start OpenVPN on the server (with the following options), it appears to start correctly.


port 1194
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh2048.pem
cipher AES-256-CBC
auth SHA512
topology subnet
server 10.8.0.0 255.255.255.0
push "dhcp-option DNS 8.8.8.8"
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

When I start OpenVPN on the client (with the following options), it too appears to start correctly.


ca keys/ca.crt
cert keys/client-no-pass.crt
key keys/client-no-pass.key
remote 192.168.0.2 1194
comp-lzo
client
dev tun
redirect-gateway local
remote-cert-tls server
cipher AES-256-CBC
auth SHA512
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
mute 20

On the client, I can see that my IP routing table has been manipulated to use the server's VPN IP address as the default route, and that all traffic to the VPN network will be sourced with tun0's IP address of 10.8.0.4.


me@client:~$ ip route
default via 10.8.0.1 dev tun0
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.4
169.254.0.0/16 dev wlp4s0 scope link metric 1000
192.168.0.0/24 dev wlp4s0 proto kernel scope link src 192.168.0.3 metric 600

When the VPN is disconnected, I can ping 8.8.8.8 (a DNS server). When the VPN is connected, I cannot.


After searching Google, I tried adding this on the server, but it doesn't help:


sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o wlan0 -j SNAT --to-source 192.168.0.2

What am I doing wrong? How can I fix it? Is my local WLAN VPN scenario simply unsupported? I've tried running Wireshark to capture tun0 traffic from the client but haven't been able to resolve the issue.


EDIT: Additional information:




  1. The server's IP address was "reserved" (by MAC address) so that the router always assigns it the same address 192.168.0.2




  2. The server is configured (by way of editing /etc/sysctl.conf) to forward IPV4 packets, and this has been tested by running cat /proc/sys/net/ipv4/ip_forward (returns 1)




  3. The server routing table shows this:





me@server:~$ ip route
default via 192.168.0.1 dev wlan0 metric 303
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.2 metric 303


  1. The server's firewall looks like this:



me@server:~ $ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 10.8.0.0/24 -i tun0 -o wlan0 -m conntrack --ctstate NEW -j ACCEPT

me@server:~ $ sudo iptables -t nat -S
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A POSTROUTING -s 10.8.0.0/24 -o wlan0 -j MASQUERADE

Answer



You need to confirm that both routing and Network Address Translation (NAT) are working properly on your VPN server. Try using tcpdump to inspect the network traffic on the server's VPN interface and Ethernet port to make sure packets are flowing, and what their addresses are. To answer your comment on whether this can be done with this design, it certainly can, and is a great way to learn about all of the involved concepts.


Here is a good guide on NAT with Linux, and many others are available too. A key thing to check is whether your system is even correctly configured for routing - by default it may be turned off. If


cat /proc/sys/net/ipv4/ip_forward


returns a zero, then it's switched off and no firewall rules will save you. You can run echo 1 > /proc/sys/net/ipv4/ip_forward to turn it on, but rather look at the entire guide to get all the necessary steps completed as well as instructions for making this change permanent (it will be lost every time you reboot otherwise).


Also, if you are using DHCP for the VPN server, then you probably want to use MASQUERADE instead of SNAT, since the IP address may change and you firewall rule will then be incorrect.


Note that if you don't want to use NAT, you will need to let your local router (the one plugged into your ISP) know that your VPN subnet (10.8.0.0/24) is behind your VPN server's IP address (192.168.0.2). Right now, it has no idea how to find 10.8.0.4, so will simply discard the reply packets.


Again, if the server's address is assigned by DHCP then this could change and you would need to update the routing entry, and you may not even be able to add this route if you are using your ISP's router and they do not permit you to administer their device.


drivers - Acer Aspire one is falling apart on Ubuntu


Question: How do I have my netbook detect and install hardware?




Info: I have an Acer Aspire One, it came with windows XP and I loaded it with Win7. I decided I wanted to change to Ubuntu so I tried Ubuntu netbook remix, which failed horribly, and so after attempting 3 or so other OS's I ended with Ubuntu Desktop 9.10. Which worked fine for a while, but there were some minor issues so I asked a question about it here and decided to change my OS again.


This last weekend I tried mandriva like that guy in my other question suggested, no success. when I had though my netbook lost the ability to use it's touch pad, I didn't think much of it, just thought it must be a driver or something. But When Mandriva failed, and I also while I was at it tried Damn small linux and Debian, which both failed to, I decided to switch back to Ubuntu Desktop(some where in here my keyboard stopped working for one attempt to). But first I gave the netbook remix one more try. it worked this time, with the exception of it didn't have any networking. I thought it was a driver issue again and finished the weekend with ubuntu desktop 9.10 again.


But now things get really crazy. it doesn't know it has a wireless card or an ethernet card. It doesn't know my phone is connected trying to provide wireless broadband either. I'm clueless on what could be the problem. And with only a minimal amount of experience with Ubuntu can't navigate the entire interface with only my keyboard(it doesn't detect a USB mouse when I plug it in, it had when I installed it. in fact the network interfaces were working just fine when I live boot ubuntu to installed it). Even so, I don't know where to go or what to do to make it recognize it's hardware. I'm in a dire situation, any help is welcome.




Update: I ran lshw and it listed Atheros AR8132 gigabit ethernet and Ar5001 Wireless network adapter. I ran lsusb and it listed Samsung (I have an omnia). So it knows they are all there, but it doesn't accept info from any of them...



Answer



Have you installed these many, many different OS OVER the existing OS? Or did you first format the whole disk, so nothing can stand in the way of the new installation. Maybe every installed system found some driverfiles and tried them... result: fail to iniciate some hardware.


macos - Is there a folder-specific .bashrc or .bash_profile?


Is it possible to have a bash script (like a .bashrc or .bash_profile, basically) that is executed only upon cd’ing into a specific folder?



Answer



Add this to your ~/.bashrc.


If .bashrc is located in current working directory:


PROMPT_COMMAND='if [[ "$bashrc" != "$PWD" && "$PWD" != "$HOME" && -e .bashrc ]]; then bashrc="$PWD"; . .bashrc; fi'

ftp - How do I upload files using the command line on Windows?


What are the FTP commands for uploading files to a server using the Windows command prompt?



Answer



Use the page Microsoft Windows Command-Line FTP Command List.


Can't install Windows 7 on Samsung SM961 M2 NVMe drive but CAN use the drive after installing the OS normally. Why?


As the title suggests, I'm having trouble installing Windows 7 64-bit on a Samsung SM961 M2 SSD drive, via the M2 slot on an Asus X-99 A motherboard.


The drive is visible to the BIOS, but not during the Windows 7 installation. However, if I install the same copy of Windows 7 on a regular drive, it immediately recognises the M2 SSD and makes it usable.


I am almost certain that this is simply a "missing driver during setup" issue, because the OS can see the SM961 after installing on a normal hard drive and, of course, my BIOS can see it just fine.


It's made trickier by the fact that the SM961 is a relatively new/unknown OEM-only part and is not (AFAIK) the same (driver-wise) as the Samsung 960.


Things I have already (unsuccessfully) tried:



  • Checked and double-checked various BIOS settings:

    • Compatibility mode allows UEFI devices

    • Secure boot is disabled




  • Loading various Samsung NVme drivers during installation:



    • These Samsung ones from HP

    • These "pure" WHQL Samsung ones




  • Slipstreaming the above drivers directly into the Windows 7 setup ISO before installation




  • Slipstreaming Microsoft's hotfixes for W7 NVme support into the setup ISO, as described on the hotfix page and on this blog:





  • Following the advice in this Reddit thread.




  • Following the advice in this Tomshardware thread.




  • Installing Windows 7 on the same PC using a regular SATA hard drive (whereupon I can immediately see the M2 drive in Windows Disk Manager) and then attempting to clone the install to the M2 drive. The drive did not boot and I haven't got the patience to mess around with "fixing" UEFI boot data.




The only thing I have not yet tried is transplanting parts of the Windows 10 ISO into the Windows 7 ISO as described in the TomsHardware post, above. Because I feel like there should be a native way to fix this and allow the Windows 7 setup to "see" the M2 drive (especially since the OS can see it immediately after installation).


Any thoughts, please?



Answer



This is more of a workaround than a real solution, so if anyone discovers a better and more consistent way to do this please comment or answer.


Install Windows on a regular drive first and then clone it to the M2 drive.


I couldn't get Windows to see the SM961 during install, however what did work was installing Windows 7 to a regular SATA hard drive. After installing all the necessary drivers for my motherboard etc. Windows was able to see the SM961, and I used a free disk imaging program (Macrium Reflect) to clone the entire SATA drive with the newly installed operating system to the SM961. I was then able to unplug the SATA drive and boot from the SM961.


I tried another clone tool (EaseUS) first which did not work.


Why does Windows change the input language randomly?


I work on an English version of Windows XP Pro, but my working language is Spanish. My default input language is set to Spanish, but sometimes Windows changes this setting automatically when you switch applications (and thus you get a different keyboard layout).


Why is that?


(I've become a huge fan of ALT + LEFT SHIFT, which lets you cycle through the available languages.)



Answer



The input language settings are per-application. An application which calls a Windows API in order to change the input locale, can set a different keyboard layout, if it is enabled for the user.


Sometimes it also happens, if you accidentally hit the ALT and LEFT-SHIFT keys together. If you don't want to have this behavior, you could "uninstall" all input languages/cultures you don't need in the Control Panel:


Regional and Language Options > Text Services and Input Languages

EDIT: or just check "Turn off advanced text services".


anti virus - How to disable/enable Microsoft Security Essentials from the command line?


I would like to know how to disable and enable Microsoft Security Essentials from the command line.


This is a common procedure on build machines in order to speed-up the build process.



Answer



To disable from the (elevated) command line:


net stop MsMpSvc

To start from the (elevated) command line:


net start MsMpSvc

However, you may get similar results by simply going in to the configuration and disable scanning on your solutions/build folder


Delete Remove 0 byte file Windows 7 64 bit

I have a file whose size is 0 bytes, there is no file extension, just says FILE. When I try to remove it an error message appears, saying "Could not find this item".


Used CMD.exe, still would not delete.



Tried to upload a screenshot of the CMD window. Upload on this site did not work, an upload button popped up I chose a the pic from my computer and it opened this blank Firefox window https://superuser.com/upload/image


How can I upload a picture? Does the picture has a size limitation? Or where can I sens a picture to save time and a lot of questions.

Virtualbox clipboard sharing

I am using virtual box. I tried to enable clipboards bidirectional option, but when I copy anything from host file to guest, the paste option is not activated.


I have installed Guest Additions.


Any idea what the problem is?

Monday 26 November 2018

How does Windows' security warning "do you want to run this file.." work?


In Windows XP, after downloading a file, when I try to run it I get



Windows XP Security Warning. Do you want to run this file... always ask before opening this file?



I moved the file into another directory (just a regular directory I created like C:\something) and ran it. I got the message, though now I don't. So maybe it was only the first time opening or something.



  • Does it happen for any executable?

  • Which executables does this happen with?


I presume Windows doesn't keep some kind of record that this file was downloaded via the internet. Any time I click the file in Chrome downloads, I get the message, but it's from Windows XP not Chrome.


How is this working?




It also seems in some way browser specific, because when I save the file and run it by saving it and clicking Open file while within K-Meleon I don't get that question. It's as if it could open it in some way that bypassed the Windows XP message.


Also, I remember the terrible days of IE and Windows 98. Maybe IE5 was the culprit, perhaps before certain updates, where the browser would just run executables from any website, without you clicking on them, unless you ticked a hard to find box in Advanced Settings.


Hopefully I can untick the box here in this security warning thing "always ask before opening this file", and it won't cause that problem. I just want an exectuable I click or double click to run.


And even when I untick that box, if I click another .exe in Chrome's downloads, it happens for that one.



Answer



Several versions ago, Internet Explorer introduced the concept of "security zones" – Internet, local intranet, "trusted", "restricted". Later, this was extended to the Windows Explorer shell (and a "My Computer" zone was added).


After downloading the file, the browser – both IE and Chrome – adds an "alternate stream" to it, named Zone.Identifier, which says that the file came from the "Internet" zone. When you double-click a file in Windows Explorer, it checks if such a stream is present, and asks for confirmation if necessary. This is not restricted to executables – any file tagged this way will require confirmation.


Alternate streams are a feature of Windows and the NTFS filesystem, and are stored on disk as part of the file. (In NTFS, the actual contents of a file is in fact an unnamed stream too.) If you want to see or edit the contents of Zone.Identifier, run in command line:


notepad MyDownloadedApp.exe:Zone.Identifier

When you uncheck the "Always prompt..." box, or when you click "Unblock" in the file properties window, the Zone.Identifier stream is deleted and Explorer won't require confirmation anymore. To delete all streams from many files at once you can use Streams or a graphical tool.


If you want to disable the zone tagging, refer to this post for Google Chrome.


windows - How to run Firefox in Protected Mode? (i.e. at low integrity level)


I noticed that Firefox, unlike Chrome and Internet Explorer, doesn't run in the Low Mandatory Level (aka Protected Mode, Low Integrity)


Google Chrome:


alt text


Microsoft Internet Explorer:


enter image description here


Mozilla Firefox:


alt text


Following Microsoft's instructions, I can manually force Firefox into Low Integrity Mode by using:


icacls firefox.exe /setintegritylevel Low 

However Firefox doesn't react well to not running with enough rights:


alt text


I like the security of knowing that my browser is running with less rights than I have. Is there a way to run Firefox into low rights mode? Is Mozilla planning on adding "protected mode" sometime? Has someone found a workaround to Firefox not handling low rights mode?




Update


From a July 2007 interview with Mike Schroepfer, VP of Engineering at the Mozilla Foundation:



...we also believe in defense in depth and are investigating protected mode along with many other techniques to improve security for future releases.



After three years it doesn't seem like it is a priority.




  • 9/28/2013

  • 5 years later

  • Firefox 24.0

  • still doesn't support protected mode



Answer



Unfortunately there is currently no way of running Firefox in Protected Mode.


If you're not running 64-bit Windows, you can get something somewhat similar using Sandboxie.


routing - How to do IP masquerading on MacOS 10.14+?


I am looking for the equivalent Macos command to the linux:


sudo iptables -t nat -A POSTROUTING -o en0 -j MASQUERADE

The reason i want to do this is I have a VPN that has the default route, but i would like certain apps to go over the physical uplink rather than the VPN.


Using pfctl i have done the following:


pass out route-to (en0 192.168.4.1) group skipvpn flags any

Where 192.168.4.1 is the ip of my gateway, and this does appear to route all packets from apps in the skipvpn group to the en0 interface (rather than the tunnel). I verify this using tcpdump


However the 'source ips' of all the packets that have been re-routed still have the source ip of the VPN (a 10.0.0.0/8 range-ip), causing things to break of course (i.e returning packets can never find their way back..)


As a result I tried to nat the source ips using this:


nat on en0 from any to any -> en0

But this does NOT appear to work, the source IPs are still broken, and do not correspond to the source ip of my en0 interface.


How do i ensure that the source ips are set correctly for these re-routed packets?



Answer



— Mac OS' Pf won't do this for you. Here's why:


If you'd take a look at its manual you'd find that NAT is happening before filtering. But NAT rules don't support all variety of hall-marks as filtering rules do. Namely there's no way to check for socket's ownership while doing NAT. You can restrict NAT rules' applicability with, say, source or destination IPs, but not ownership.


Another thing to mention is during NAT processing Pf's doing normal route look up. It means you won't have nat on en0 working at all — the packets are routed according to kernel's routing table at that moment. In your case they are dispatched to be sent via default route's interface which is VPN interface. And they would be using VPN interface's address as theirs source IPs — which is not surprising for normal route look ups, but obviously isn't playing along with your plan.


To summarise the contradictions, briefly:



  • If you don't do NAT you have wrong Source IP when route-to is applied

  • Your NAT rule should be set on default route interface (VPN) while changing Source IP to IP of non-VPN interface, like: nat on vpn0 … -> (en0)

  • But OTOH you can't have custom NAT (by ownership) and if you do NAT anyways then traffic that is supposed to go via VPN would have wrong Source IP.


P. S. The actual state of things in Mac OS's Pf is even worse. After NAT is done ownership matching won't work in filtering rules either.


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