Wednesday, December 31, 2014

Linux Docker containers - LAMP for web development


This is a straight forward guide for configuring Docker to have a Debian LAMP workstation:
This guide should work on any Debian-based distro.
Please read carefully the entire post if you are new to docker.

Install docker: sudo apt-get install docker 
Download debian Docker image: sudo docker pull debian 
Run root shell inside container: sudo docker run -i -t debian /bin/bash
Now you're inside the Debian image, execute the following commands:
apt-get update && apt-get install apache2
apt-get install mysql-server mysql-client
apt-get install php5 php5-mysql libapache2-mod-php5
apt-get install openssh-server
apt-get install vim
# I'm used to vim, you can omit this step
apt-get install git # I use git for version control. You can install subversion or omit this step
# Now let's autostart the services
echo service ssh start >> /etc/bash.bashrc
echo service mysql start >> /etc/bash.bashrc
echo service apache2 start >> /etc/bash.bashrc
 
# Back to your host
exit

Now you can commit your changes to the image
Get container id: sudo docker ps -a
Commit the changes: sudo docker commit <id> <descr> # Replace <id> with the container id from previous step and <descr> with description of image.
Get image name: sudo docker images
Assign port forwarding for apache and ssh (replace port numbers as you see fit): sudo docker run -i -t -p 800:80 -p 2222:22 <image_name> /bin/bash
Commit again: sudo docker commit <id> <descr> 
     

That's it, to start the container again you need it's id (that can be obtained with the command "sudo docker ps -a")
sudo docker start <container id>
sudo docker attach <container id>

I use this one liner:
id=<container id>; sudo docker start $id && sudo docker attach $id

You don't necessarily need to attach to the container, but if you are going to commit changes and edit files in the container you'll need to.

It's important to note that "docker run" creates a new image without uncommitted changes. What you want to use most of the times is start & attach.

To access it's webserver, on a browser type "localhost:800", to log in via ssh on host/ip type localhost and use port 2222. This way you don't need to setup a static ip on the container, and if you're working alone it's the most convenient way to do it. You'll need to create a user for ssh login.

I made an alias of that one liner to start docker, so the development environment is up in the time it takes me to type a single word.






Thursday, December 11, 2014

Dual LM386 guitar power amplifier


This is a simple modification to the Dual Power King amplifier from beavisaudio.com.
What's funny is that I have a motorboating sound from an LM380 amplifier and decide to build this dual power king and I ended up with the same problem. "Motorboating", oscilating.
That happens when you don't have a bypass capacitor between power and ground. So this one cap modification turns this dual power king into a usable amp.



With a tonemender as a preamp sounds really goood.


Monday, December 8, 2014

Analogue Drums BlackSmith drumkit in Hydrogen - Linux

Here's a script I've made that converts your BlackSmith Samples directory from this:

to this:

It categorize the samples in micking and round robin, so it's easier to import them from hydrogen.
That is, it adds the closemic, kicksubmic, overheadmic, roommic, smashmic and snarebottom, and inside those directories it adds folders for each round robin samples.


WARNING: Make sure you have a backup of the samples prior to execute this script. I'm not responsible if you loose your samples. This script is distributed without warranties.


The script can be customized to adapt to other Analogue drums kits. You can download it from here https://github.com/Rombusevil/romboscripts/blob/master/blackSmith.sh


You need to unzip the BlackSmith zip that Analogue drums provides you when you purchase the drum kit and change dir to BlackSmith/Samples from a terminal window, then copy this script to that directory and execute it. That's it. Now you can import the samples from Hydrogen in an easier way.

I'll see if I can make an scriptable Hydrogen drumkit generator for this drumkit. If not, a tutorial on how to do it will follow.

This post is really shallow, I'll make another one explaining the directory structure and how to pick the right sounds in instrument layers on Hydrogen.