Writing by shivdev on Thursday, 18 of December , 2014 at 11:42 pm
Here’s a Quick Reference to get started
| Description |
SQL |
Mongo DB |
|
| Lingo 1 |
Table; Relation |
Collection |
|
| Lingo 2 |
Row; Record; Tuple |
Document |
|
| List Databases |
SHOW databases |
show databases |
|
| List Tables |
SHOW tables |
show collections |
|
| Switch to a DB |
USE db |
use db |
|
| Show Table Data |
SELECT * FROM table |
db.collection.find.pretty() |
|
| Filter Table Data |
WHERE colum = 'value' |
db.collection.find({'column':'value'}) |
|
| Select Columns |
SELECT col1, col2 |
db.collection.find({},{col1:1, col2:1}) |
|
| Delete Rows |
DELETE FROM table WHERE col='val' |
db.collection.remove({'col':'val'}) |
|
| Get Rid of a Table |
DROP table |
db.collection.drop() |
|
| |
|
|
|
Category: MongoDB,SQL DB
Writing by shivdev on Wednesday, 3 of December , 2014 at 10:38 pm
Honestly, I found syslog-ng simpler to use once I knew The Basics. However, I also needed to do some testing with rsyslog and hence needed to dig in.
Setup and configure the Host Machine where you will receive the syslog messages.
# 1. Install rsyslog
$ sudo apt-get install rsyslog
# 2. Backup the config file syslog-ng.conf
$ sudo cp /etc/rsyslog.conf /etc/rsyslog.conf.orig
# 3. Edit the config file
$ sudo vi /etc/rsyslog.conf
# 4. Enable TCP/UDP by Uncommenting the following
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
# Add a file that will be the destination for your Syslog
local5.* /var/log/my_rsyslog.log
# 5. Restart rsyslog
$ sudo service rsyslog restart
When you configure your Appliance to forward syslog to your Host at local5, you will see the logs in “/var/log/my_rsyslog.log”.
Category: Linux