Drop database and then restore (Postgresql 10.4.0):
1. su as postgres
2. run psql at command prompt
3. First, find the activities that are taken place against the target database, you can query the pg_stat_activity view with the following query:
SELECT
*
FROM
pg_stat_activity
WHERE
datname = 'target_database';
4. Second, terminate the active connections by issuing the following query:
SELECT
pg_terminate_backend (pg_stat_activity.pid)
FROM
pg_stat_activity
WHERE
pg_stat_activity.datname = 'target_database';
5. Third, execute the DROP DATABASE statement:
DROP DATABASE target_database;
6. Create database:
CREATE DATABASE target_database;
7. Copy file from host to docker container:
docker cp src/. mycontainer:/target
8. Go into docker container and restore database:
docker container exec -it mycontainer bash
su postgres
psql target_database < infile
That's all folks!
Thursday, September 27, 2018
After Jenkins successfully shutdown, my Gitlab CE is now using port 8080 so I need to shut it down also to make way for my WildFly Application Server. Command issued to shutdown Gitlab CE are as follows:
1. su as root
2. At command prompt: gitlab-ctl stop
Referred from here: https://docs.gitlab.com/omnibus/maintenance/
That's all folks!
1. su as root
2. At command prompt: gitlab-ctl stop
Referred from here: https://docs.gitlab.com/omnibus/maintenance/
That's all folks!
My Jenkins Server automatically starts upon Centos 7 server starts, so I need to stop it to make way for my WildFly Application Server. What I did to stop it are as follows:
1. On my Firefox browser, go to this url :
2. It will ask me to login then i have to click some button to initiate the shutdown process
I saw someone also asking about the same thing at stackoverflow: https://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely/35922474
It's that easy folks!
1. On my Firefox browser, go to this url :
http://localhost:8080/exit
2. It will ask me to login then i have to click some button to initiate the shutdown process
I saw someone also asking about the same thing at stackoverflow: https://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely/35922474
It's that easy folks!
Wednesday, September 5, 2018
Install PgAdmin4 on Centos 7
Install PgAdmin4 on Centos7
PgAdmin4 is GUI Tool to manage PostgreSQL database. I have a problem installing the latest PgAdmin4 which is v3.2 in Windows 10 on my HP EliteBook x360 so I made the decision to install it on my VMware Virtualised Centos 7 server.
This is what I did to install PgAdmin4 on Centos 7:
1. Get the yum repository installed on my server
2. Install PgAdmin4 Desktop Gnome
sudo yum -y install pgadmin4-desktop-gnome
That's all folks.
Fyi, I referred to https://people.planetpostgresql.org/devrim/index.php?/archives/96-Installing-pgAdmin4-3.X-on-RHEL-CentOS-7-and-Fedora-27.html for this.
PgAdmin4 is GUI Tool to manage PostgreSQL database. I have a problem installing the latest PgAdmin4 which is v3.2 in Windows 10 on my HP EliteBook x360 so I made the decision to install it on my VMware Virtualised Centos 7 server.
This is what I did to install PgAdmin4 on Centos 7:
1. Get the yum repository installed on my server
- Get the yum repo rpm
wget -v https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
Get the rpm location from https://yum.postgresql.org/repopackages.php
- Install the yum repo
sudo rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
- Install PgAdmin4
sudo yum -y install pgadmin4
- Configure PgAdmin4
cd /usr/pgadmin4/bin/
su./pgadmin4-web-setup.sh
NOTE: Configuring authentication for SERVER mode.Enter the email address and password to use for the initial pgAdmin user account: Email address: edyzairani@gmail.com
Password:
Retype password:
pgAdmin 4 - Application Initialisation
====================================== We can now configure the Apache Web server for you. This will create the pgAdmin4 conf file under /etc/httpd/conf.d/. Do you wish to continue?
1) Yes
2) No
#? 1 pgAdmin4 Apache config file is created as /etc/httpd/conf.d/pgadmin4.conf
Apache web server is not running. We can start the web server for you to finish pgAdmin4 installation. Would you like to continue?
1) Yes
2) No
#? 1
Apache successfully started. You can now start using pgAdmin4 in web mode
2. Install PgAdmin4 Desktop Gnome
sudo yum -y install pgadmin4-desktop-gnome
That's all folks.
Fyi, I referred to https://people.planetpostgresql.org/devrim/index.php?/archives/96-Installing-pgAdmin4-3.X-on-RHEL-CentOS-7-and-Fedora-27.html for this.
Thursday, January 3, 2013
Folate Recommended Daily Intake
Folate is a B vitamin that is naturally present in many foods. Folic acid is a synthetic form of folate and can be found in many supplements and fortified foods. Folate is important for the formation of new blood cells and the production of DNA and RNA, genetic materials in your body. Because of its role in red blood cell formation, folate helps prevent fatigue and anemia in your body. According to the Linus Pauling Institute, the recommended daily intake of folate for adults is 400 mcg.
Read more: http://www.livestrong.com/article/342051-a-list-of-foods-containing-folate/#ixzz2Gxk2Ax8Z
Folate needs increase with age, and pregnant and breastfeeding women need more folate than other adults. Pregnant women should get 600 mcg of folate per day, and breastfeeding women 500 mcg per day, according to the National Institutes of Health Office of Dietary Supplements. Adolescents and adults ages 14 and over need 400 mcg of folate per day, while children ages 9 to 13 need only 300 mcg per day and children ages 4 to 8 need 200 mcg per day. Children ages 1 to 3 should get 150 mcg of folate per day.
Read more: http://www.livestrong.com/article/484257-peanut-butter-folic-acid/#ixzz2GxjSRYYW
If you take more than 1,000 mcg of folic acid in the form of vitamins and supplements, you could be at risk for vitamin B-12 deficiency, which can trigger anemia and eventually damage your nerves. Older adults are at higher risk of vitamin B-12 deficiency due to age and should check with their physicians before beginning a folic acid supplement or a daily vitamin with excess folic acid. If you take anti-seizure medications, you could be at risk of having seizures if you take too much folic acid.
Read more: http://www.livestrong.com/article/402494-what-are-the-results-of-too-much-folic-acid/#ixzz2GxkmBVnC
Subscribe to:
Posts (Atom)
Install MySQL 8.0 on Centos 7
Steps to install MySQL 8.0 Community Edition in Centos 7 1. Enable MySQL 8.0 Repository sudo yum localinstall https://dev.mysql.com...
-
Steps to install MySQL 8.0 Community Edition in Centos 7 1. Enable MySQL 8.0 Repository sudo yum localinstall https://dev.mysql.com...
-
My Jenkins Server automatically starts upon Centos 7 server starts, so I need to stop it to make way for my WildFly Application Server. Wha...