Databases are all about saving data. With DBMS and RDBMS, the entire data became relational and all the records became related to each other as in the real world. So came into existence the concepts of primary keys, foreign keys, foreign key constraints and whole bunch of other terms like composite keys, referential integrity, indexes and what not.
Repacking an unpacked JAR is a little frustrating because of the folder structure
When unpacking with:
jar xvf JAR_NAME.jar
you get a
To repack the JAR:
remove old jar
get inside the folder
pack the jar referencing the parent folder
jar cf ../JAR_NAME.jar *
and you will end up with the JAR_NAME.jar in the parent folder, where the original was unpacked from, without the first folder level you would get if you had packed the folder itself.
In this post, we will see how to send HTTP Get/Post in java.
There are many times when you need to send HTTP GET or POST request. You can use HttpURLConnection for sending get/post request in java. It belongs to java.net package.
In the simplest terms,
git pull does a
git fetch followed by a
You can do a
git fetch at any time to update your remote-tracking branches under
This operation never changes any of your own local branches under
refs/heads, and is safe to do without changing your working copy. I have even heard of people running
git fetchperiodically in a cron job in the background (although I wouldn’t recommend doing this).
git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.
Git documentation: git pull
netstat -vanp tcp | grep 3000
- For macOS and newer (or if your netstat doesn’t support
lsof -i tcp:3000
kill -9 <PID>
mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:
—routines – FALSE by default
—triggers – TRUE by default
This means that if you want to include in an existing backup script also the triggers and stored procedures you only need to add the —routines command line parameter:
mysqldump <other mysqldump options> --routines outputfile.sql
Let’s assume we want to backup ONLY the stored procedures and triggers and not the mysql tables and data (this can be useful to import these in another db/server that has already the data but not the stored procedures and/or triggers), then we should run something like:
mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database> > outputfile.sql
and this will save only the procedures/functions/triggers of the . If you need to import them to another db/server you will have to run something like:
mysql <database> < outputfile.sql
SHOW PROCEDURE STATUS; SHOW FUNCTION STATUS;
For MySQL you can specify your user and password in local config file (
.my.cnf). This file should be in your home directory (i.e. ~/.my.cnf).
[mysql] user=user password=password
You’re looking for:
gzcat x.txt.gz >x.txt
gzcat command is equivalent to
gunzip -c which simply writes the output stream to
stdout. This will leave the compressed file untouched. So you can also use:
gunzip -c x.txt.gz >x.txt
Note that on some systems gzcat is also known as
zcat so run like this instead:
zcat x.txt.gz >x.txt