How to restart Postgresql

Try this as root (maybe you can use sudo or su): Without any argument the script also gives you a hint on how to restart a specific version Similarly, in case you have it, you can also use the service tool: Please, pay attention to the optional [version …] trailing argument. That’s meant to allow you, the user, to act on a specific … Read more

Using putty to scp from windows to Linux

You need to tell scp where to send the file. In your command that is not working: You have not mentioned a remote server. scp uses : to delimit the host and path, so it thinks you have asked it to download a file at the path \Users\Admin\Desktop\WMU\5260\A2.c from the host C to your local home directory. The correct upload command, based on your comments, … Read more

How can I exclude directories from grep -R?

SOLUTION 1 (combine find and grep) The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5. Use find, for excluding directories foo and bar : Then combine find and the non-recursive use of grep, as a portable solution : SOLUTION 2 (using the –exclude-dir option of grep): … Read more

“sed” command in bash

sed is the Stream EDitor. It can do a whole pile of really cool things, but the most common is text replacement. The s,%,$,g part of the command line is the sed command to execute. The s stands for substitute, the , characters are delimiters (other characters can be used; /, : and @ are popular). The % is the pattern to match (here a literal percent sign) and the $ is the second pattern … Read more

How to exclude a directory in find . command

Use the -prune primary. For example, if you want to exclude ./misc: To exclude multiple directories, OR them between parentheses. And, to exclude directories with a specific name at any level, use the -name primary instead of -path.

How can I exclude directories from grep -R?

SOLUTION 1 (combine find and grep) The purpose of this solution is not to deal with grep performance but to show a portable solution : should also work with busybox or GNU version older than 2.5. Use find, for excluding directories foo and bar : Then combine find and the non-recursive use of grep, as a portable solution : SOLUTION 2 (using the –exclude-dir option of grep): … Read more

Curl command for https ( SSL )

if you’re using a self signed certificate on the server, you can use: but be aware that then it’s no better than using non SSL connection to the server, as your communication won’t be secure anymore, enabling all sorts of man in the middle attacks. Though my advice to you is to download the .pem from the … Read more

Python virtualenv questions

Normally virtualenv creates environments in the current directory. Unless you’re intending to create virtual environments in C:\Windows\system32 for some reason, I would use a different directory for environments. You shouldn’t need to mess with paths: use the activate script (in <env>\Scripts) to ensure that the Python executable and path are environment-specific. Once you’ve done this, the command prompt changes to indicate the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)