Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

In my case, I had an incorrect or not accessible URL in /etc/apt/sources.list. After removing this URL, I was able to update all packages successfully.

Commands:

***sudo vi /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade***
4 years ago
You could do that by using **screen**.

Type **man** screen to find out more or read this screen man page.

Simple scenario:

ssh into your remote box. Type **screen** Then start the process you want.

Press **Ctrl-A** then **Ctrl-D**. This will "detach" your screen session but leave your processes running. You can now log out of the remote box.

If you want to come back later, log on again and type **screen -r** This will "resume" your screen session, and you can see the output of your process.
4 years ago
There are a number of different ways to do this. One is using sed and Regex. SED is a Stream Editor for filtering and transforming text. One example is as follows:

***marco@imacs-suck: ~$ echo "The slow brown unicorn jumped over the hyper sleeping dog" > orly
marco@imacs-suck: ~$ sed s/slow/quick/ < orly > yarly
marco@imacs-suck: ~$ cat yarly
The quick brown unicorn jumped over the hyper sleeping dog***
Another way which may make more sense than **< strin** and **> strout** is with pipes!

***marco@imacs-suck: ~$ cat yarly | sed s/unicorn/fox/ | sed s/hyper/lazy/ > nowai
marco@imacs-suck: ~$ cat nowai
The quick brown fox jumped over the lazy sleeping dog***
4 years ago
PowerShell version 4 and up includes the Get-FileHash cmdlet.

***powershell get-filehash -algorithm md5 ***
Use doskey to make a persistent alias that's easier to remember.

***doskey sha1sum=powershell get-filehash -algorithm sha1 "$1"
doskey md5sum=powershell get-filehash -algorithm md5 "$1"***
4 years ago
It is very simple to demonstrate input lag on monitors, just stick an lcd next to a crt and show a clock or an animation filling the screen and record it. One can be a second or more behind. It is something that LCD manufacturers have tightened up on since gamers, etc have noticed it more.
4 years ago
Environment variable ***GIT_SSH_COMMAND:***
From Git version 2.3.0, you can use the environment variable ***GIT_SSH_COMMAND*** like this:

***GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example***
Note that **-i** can sometimes be overridden by your config file, in which case, you should give SSH an empty config file, like this:

***GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example -F /dev/null" git clone example***
Configuration ***core.sshCommand:***
From Git version 2.10.0, you can configure this per repo or globally, so you don't have to set the environment variable any more!

***git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"
git pull
git push***
4 years ago
If you do not know the program the file it is using then you can go to My Computer; right click; select Manage. Under System Tools > Shared folders > Open Files, you should be able to see the user who has locked the file. You can close file from here and then you can perform the task of rename or delete the file.
4 years ago
Clicking "clear host cache" in ***chrome://net-internals/#dns*** should do it for Google Chrome, but there are other DNS caches to consider on your machine.
Windows:

***ipconfig /flushdns***
4 years ago
At some point **tar** was upgraded to auto-decompress. All you need now is:

***tar xf community_images.tar.gz***
The same explanation applies:

**f:** this must be the last flag of the command, and the tar file must be immediately after. It tells tar the name and path of the compressed file.
**x:** extract the files.
Note the lack of hyphen for the command flags. This is because most versions of tar allow both gnu and bsd style options (simplistically, gnu requires a hyphen, bsd doesn't).
4 years ago
o get a list of all users you type (as users are listed in** /etc/passwd)**

***getent passwd***
To add a user newuser to the system you would type

***sudo adduser newuser***
to create a user that has all default settings applied.

Bonus: To add any user (for instance anyuser) to a group (for instance cdrom) type

***sudo adduser anyuser cdrom***
You delete a user (for instance obsolete) with

***sudo deluser obsolete***
If you want to delete his home directory/mails as well you type

***sudo deluser --remove-home obsolete***
And

***sudo deluser --remove-all-files obsolete***
will remove the user and all files owned by this user on the whole system.
4 years ago
An alternate is **rsync**:

***rsync -a source/ destination***
The advantages of **rsync** are:

After the initial sync, it will then copy only the files that have changed.
You can use it over a network, convenient for files in $HOME, especially config files.
4 years ago
You can also use **tee** to send the output to a file:

***command | tee ~/outputfile.txt***
A slight modification will catch stderr as well:

***command 2>&1 | tee ~/outputfile.txt***
or slightly shorter and less complicated:

***command |& tee ~/outputfile.txt***
**tee** is useful if you want to be able to capture command output while also viewing it live.
4 years ago