Categories
Development

Projects

I have over 400 projects in my src directory that I have worked on, played around with or tested.   I forgot what most of these do so in my spare time, will add the git README.md file into each directory.

The new format for this document will be:


Project:
Hacker Tracker

Description:
Casualcoder.net gets lots of traffic testing the ssh. This program goes through the auth.log file for the previous day to find who and place this info into a db for analzying

DateCreated:
20190528

git:no jenkins:no docker:no

Directory:
/src/cplus-hacktrack

Keywords:
c++ mongo bash

I think this will make it easier to find snippets or ideas when I need them.

the git: line will be a quick yes or no if the tools I use often are being used in this project.

I found that for me, naming the directory with

 

Categories
Linux

linux distro and version

which distro and version am I running?  If you run a few, try this command:

lsb_release -a

Categories
Docker Mariadb

docker mysql load dump file

This is how to load a sql dump file from directory to a mysql database in a container.

Make sure you have a volume set up with the directory you keep your sql files in.  In my case, I have a directory called “/data/raw” that I keep all my csv and sql files in for loading and dumping.

docker command

sudo docker run --name some-mariadb -v /data/mysql:/var/lib/mysql -v/data/raw:/data/raw-e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb:latest

or…

docker-compose yaml file.


  mariadb:
    image: mariadb
    container_name: some-mariadb
    environment:
    - "MYSQL_ROOT_PASSWORD:my-secret-pw"
    volumes:
    -  /data/mysql:/var/lib/mysql
    - /data/raw:/data/raw
    ports:
    - 3306:3306

I change the directory to my /data/raw directory on my linux box that I’m running the container on.

To load a file into mysql/mariadb, open mysql from the command line:


docker exec -it  some-mariadb mysql -u root -pmy-secret-pw my-database

 

and then…


MariaDB []> source /data/raw/dump-file_data.sql

 

I use the same method for postgres