Creating pg_dump file in OS terminal - sql

I tried to find it out on google, but didn't worked well so I hope to find help here! :)
I am trying to create a pg_dump file on mac osx but there is no \bin folder as needed in cmd on windows.
My question is how to create the pg_dump file on mac osx?
Best regards!

Depends on where you installed PostgreSQL from. If its the .dmg from postgresql.org then the command will be in:
/Library/PostgreSQL/<version eg. 9.6>/bin
This is not in the PATH so you will have to either cd to the directory and run the command or add the directory to the PATH.
Another option is to search for the command with:
cd /
find ./ -name pg_dump

Related

pocketbase: command not found

I am trying to set up a pocketbase on a Debian server.
on the server I created a dir called pb and scp over the pocketbase file which I downloaded from https://pocketbase.io/docs/
I downloaded all three linux packages pocketbase_0.10.2_linux_amd64.zip , pocketbase_0.10.2_linux_arm64.zip and pocketbase_0.10.2_linux_armv7.zip
I download the file, unzip it and then move the pocketbase file over to the server.
Note, Ive downloaded these onto a windows machine and then SCP pocketbase file over to my server.
When I run pocketbase serve I get the error command not found.
I can't find a good solution to this issue.
Execute it as instructed by pocketbase's documentation if you are within the same directory as the bin file:
./pocketbase serve
If you want to run it as pocketbase serve alone you will need to move the bin file under /usr/bin or ideally /usr/local/bin which should be under your system's $PATH variable.
https://pocketbase.io/docs/
Run ./pocketbase --help or ./pocketbase [command] --help for more assistance.

Flatpak Intellij Idea - problem with subversion executable

After installing Intellij Idea using flatpak on Clear Linux I'm not able to make it run svn executable.
I added ---filesystem=host to flatpak permissions and tried to set executable path to /run/host/usr/bin/svn but with no luck (path is available/exists, though Intellij keeps complain)
svn command is normally available from system terminal.
When I try to run /run/host/usr/bin/svn command via Intellij Idea built-in terminal, I've got error that library is not available:
sh-5.0$ /run/host/usr/bin/svn
/run/host/usr/bin/svn: error while loading shared libraries: libsvn_client-1.so.0: cannot open shared object file: No such file or directory
I also tried set flatpak-spawn. Following command works perfectly fine in Intellij Idea built-in terminal:
/usr/bin/flatpak-spawn --host /usr/bin/svn, though when set as path to svn executable still gives me Intellij Idea error:
"The path to Subversion executable is probably wrong"
Could anybody please help with making it work?
TLDR: You probably need to add the path to svn into your IntelliJ terminal Path.
Details:
It looks like you are having a path issue. I had a similar problem running kubectl running PyCharm installed from a flatpak on Pop_Os.
If I try to run kubectl I see the following:
I have kubectl installed in /usr/local/bin. This is a screenshot from my 'normal' terminal.
In the PyCharm terminal this location is mounting under /run/host/usr/local/bin/.
If I look at my path in the PyCharm terminal, it is not there.
So I'll add the /run/host/usr/local/bin/ to my path and I can then run kubectl:
To make sure this comes up all the time, I need to add the PATH to the Terminal settings:
I can now execute any of the commands in my /usr/local/bin dir.
I found a really ugly solution for dealing with SVN with the JetBrains family, which does actually answer the question. But in a very roundabout way. Unfortunately Alex Nelson's solution didn't work for me.
You would think the Flatpak would come with a valid SVN, since it's actually part of the expected requirements for the program...
When in the terminal, you can run
cd ..
/usr/bin/flatpak-spawn --host vim ./svn
Then press i to go into input mode, then paste the following in the opened text file (Basically what it does is create an executable which passes it to the flatpak-spawn invocation):
#!/bin/bash
/usr/bin/flatpak-spawn --host /usr/bin/svn $#
Save and quit from vim (ESC, then :wq!). Make it executable:
chmod +x svn
Then in IntelliJ's menu, set the "path to svn" to
/home/<yourusername>/IdeaProjects/svn
It's worked for everything I've tried... Hope this helps out anyone else who was struggling with this.
I am using a similar solution to caluga.
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host /usr/bin/env -- svn "$#"
exec makes it replace the wrapper script process so the wrapper script process can end.
I'm using /bin/sh instead of /bin/bash as bash features are not needed.
using /usr/bin/env, but maybe not necessary if PATH is set up right.
remember to quote "$#" in case there are spaces in arguments.
I am putting it in ~/.local/bin and referencing it with its absolute path in the IntelliJ settings (Settings -> Version Control -> Subversion -> Path to Subversion executable).
I also was running into problems with IntelliJ saying that /app/idea-IC path does not exist. Figured that something outside the flatpak (i.e. svn or env) was trying to change directory to the working directory from where the wrapper script was invoked (inside the flatpak). Using cd allows the wrapper script to change to a directory that exists both inside the flatpak and on the host.
Fedora Silverblue or toolbox users might want to use dev tools inside their toolbox, in which case you can do:
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host toolbox run svn "$#"

How do I remove CLion-2016.2.3 completely from Ubuntu 16.04 LTS?

I had installed CLion(2016.2.3) IDE from CLion-2016.2.3.tar.gz file. I accidentally deleted the CLion-2016.2.3.tar.gz file and CLion-2016.2.3 folder(which I got after extracting CLion-2016.2.3.tar.gz). Now CLion isn't working. When I ran dpkg --list from terminal, CLion wasn't present in the output. I want to remove CLion completely(all its files, folders, dependencies, etc.(even the configuration files)). How do I remove it completely?
Run the following command in terminal to find all the directories and files containing clion in their name :-
$ sudo find . -iname "*clion*"
Then delete the directories and files you have found.
To delete directories/files, go to the location of that directory/file in terminal using cd and run the following command :-
$ sudo rm -rf DIRECTORY_NAME/FILE_NAME
Simple Steps are :
Delete the clion folder you have downloaded and extracted.
Remove cache in ~/. using the command : sudo rm -r ~/.Clion.
Also need remove settings: /home/user/.config/JetBrains
You need also to remove settings that are stored in ~/. directory. That's it for Unix/Linux.
All Clion's binaries are store inside the folder you deleted.
But Clion sets up preferences at first launch, and you may have a menu icon which is pointing nowhere.
I suggest you run something like find ~ -iname "*clion*" and investigate what is found. If you are using Gnome2 or MATE desktop you will certainly find .desktop files which are the icons you are looking for.
If you used snap to install you can uninstall using
sudo snap remove --purge clion

Running .sh scripts in Git Bash

I'm on a Windows machine using Git 2.7.2.windows.1 with MinGW 64.
I have a script in C:/path/to/scripts/myScript.sh.
How do I execute this script from my Git Bash instance?
It was possible to add it to the .bashrc file and then just execute the entire bashrc file.
But I want to add the script to a separate file and execute it from there.
Let's say you have a script script.sh. To run it (using Git Bash), you do the following: [a] Add a "sh-bang" line on the first line (e.g. #!/bin/bash) and then [b]:
# Use ./ (or any valid dir spec):
./script.sh
Note: chmod +x does nothing to a script's executability on Git Bash. It won't hurt to run it, but it won't accomplish anything either.
#!/usr/bin/env sh
this is how git bash knows a file is executable. chmod a+x does nothing in gitbash. (Note: any "she-bang" will work, e.g. #!/bin/bash, etc.)
If you wish to execute a script file from the git bash prompt on Windows, just precede the script file with sh
sh my_awesome_script.sh
if you are on Linux or ubuntu write ./file_name.sh
and you are on windows just write sh before file name like that sh file_name.sh
For Linux -> ./filename.sh
For Windows -> sh file_name.sh
If your running export command in your bash script the above-given solution may not export anything even if it will run the script. As an alternative for that, you can run your script using
. script.sh
Now if you try to echo your var it will be shown. Check my the result on my git bash
(coffeeapp) user (master *) capstone
$ . setup.sh
done
(coffeeapp) user (master *) capstone
$ echo $ALGORITHMS
[RS256]
(coffeeapp) user (master *) capstone
$
Check more detail in this question
I had a similar problem, but I was getting an error message
cannot execute binary file
I discovered that the filename contained non-ASCII characters. When those were fixed, the script ran fine with ./script.sh.
Once you're in the directory, just run it as ./myScript.sh
If by any chance you've changed the default open for .sh files to a text editor like I had, you can just "bash .\yourscript.sh", provided you have git bash installed and in path.
I was having two .sh scripts to start and stop the digital ocean servers that I wanted to run from the Windows 10. What I did is:
downloaded "Git for Windows" (from https://git-scm.com/download/win).
installed Git
to execute the .sh script just double-clicked the script file it started the execution of the script.
Now to run the script each time I just double-click the script
#!/bin/bash at the top of the file automatically makes the .sh file executable.
I agree the chmod does not do anything but the above line solves the problem.
you can either give the entire path in gitbash to execute it or add it in the PATH variable
export PATH=$PATH:/path/to/the/script
then you an run it from anywhere

Oracle SQL Developer: sharing configuration via Dropbox

I would like to share my Oracle SQL Developer configuration across my several computers that use Dropbox.
How can I do this?
In case anyone comes here looking for the location of user configured options like me, they are hiding here:
%appdata%\SQL Developer\
This is useful to know when copying your preferences to a new computer. If you are looking for the connection settings, search for connections.xml in that directory. There are also some other configuration files here that you may need:
sqldeveloper.conf – <sqldeveloper dir>\sqldeveloper\bin\
ide.conf – <sqldeveloper dir>\ide\bin\
This is for Oracle SQL Developer 3.
Here's what I did.
#!/bin/bash
# share sqldeveloper config via dropbox
# this is for sqldeveloper 1.5.4, change your paths as necessary
# strace or dtruss sqldeveloper to see what config files are accessed
ITEMS="
o.ide.11.1.1.0.22.49.48/preferences.xml
o.ide.11.1.1.0.22.49.48/settings.xml
o.jdeveloper.cvs.11.1.1.0.22.49.48/preferences.xml
o.jdeveloper.subversion.11.1.1.0.22.49.48/preferences.xml
o.jdeveloper.vcs.11.1.1.0.22.49.48/preferences.xml
o.sqldeveloper.11.1.1.59.40/preferences.xml
o.sqldeveloper.11.1.1.59.40/product-preferences.xml
"
INST=~/Library/Application\ Support/SQL\ Developer/system1.5.4.59.40
DROP=~/Dropbox/Library/SQL\ Developer/system1.5.4.59.40
# note, you can zap your configuration if you are not careful.
# remove these exit lines when you're sure you understand what's
# going on.
exit
# copy from real folder to dropbox
for i in $ITEMS; do
echo uncomment to do this once to bootstrap your dropbox
#mkdir -p "`dirname "$DROP/$i":`"
#cp -p "$INST/$i" "$DROP/$i"
done
exit
# link from dropbox to real folder
for i in $ITEMS; do
rm "$INST/$i"
ln -s "$DROP/$i" "$INST/$i"
done
Simple sharing SQLDeveloper config on Dropbox, the easiest way on MACOSX is to
cd ~/Dropbox
mkdir -p Library/SQLDeveloper
cp -rp ~/.sqldeveloper/* Library/SQLDeveloper/
mv ~/.sqldeveloper ~/remove_when_sure_sqldeveloper
ln -sf $PWD/Library/SQLDeveloper ~/.sqldeveloper
Do this on your most important machine and on the machine on which to share only do
cd ~/Dropbox
mv ~/.sqldeveloper ~/remove_when_sure_sqldeveloper
ln -sf $PWD/Library/SQLDeveloper ~/.sqldeveloper
This works like a charm.