I’ve been exploring dockerizaton lately more and more and I think I like the idea of having my apps in containers. I am not going to lie, it does take some time to get used to, but it is pretty cool the things that you can do.
One thing that I think I wanted to accomplish was able to run X11 apps through docker. I found Docker Headless VNC container and that was slick. Where I was able to run a whole Xfce environment within a Docker container!!! kudos to those folks. Now, my challenge was that in my case, I didn’t want a fat image and/or configure each app to download of configuring. So, this wasn’t my solution at this time. So, I decided to explore further and found a way to run X11 from a Docker container in macOS. Below are the steps on how to accomplish this.
- Install XQuartz (X11), Docker and homebrew. You can follow their respective installation process.
- Install socat which is a “multipurpose relay.” This will allow us to call the display.
- Create you local Dockerfile. In this particular case, I am using Ubuntu latest (which at the time of this post is 16.04.1 LTS). On your terminal, you can do “vi Dockerfile” and paste the info from below in that file.
RUN apt-get update && apt-get install -y firefox
RUN useradd -ms /bin/bash developer && \
echo "\ndeveloper ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ENV HOME /home/developer
- Then, let’s build the Docker image by doing the following…
docker build -t firefox .
- Now, on a different terminal, run the following command…
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
- Then come back to your old terminal (or a different one) and run this command
docker run -ti --rm \
-e DISPLAY=$(ipconfig getifaddr en0):0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
- At this point, you should have opened a Firefox instance from your Docker container through X11 on macOS 🙂
If you didn’t… take a look at the steps again. Happy dev and opening other X11 instances.
Recently I started to so some dev on python and noticed that on the server that I was going to do the work I don’t have sudo access. In the past, this has not been an issue, but in this case getting sudo access is almost impossible and not doable. So my only option is being able to run pip (to install python packages) as an user.
After painfully researching on how to successfully do this, I was able to make it work. I hope that this helps others in the future. Good luck!
- Make sure that you have python installed
- Download latest version of virtual environment (virtualenv)
- Unpack source tarball
tar -xzf virtualenv-15.1.0.tar.gz
- Create your package environment
python virtualenv-15.1.0/virtualenv.py py-packages
- Delete the virtual environment folder
rm -rfv virtualenv-15.1.0
- Install virtualenv into your environment. You can use the package that you downloaded or using pip.
py-packages/bin/pip install virtualenv-15.1.0.tar.gz
py-packages/bin/pip install virtualenv
- If you want to clone environments you can do the following
Enroll for Big Data, Data Science – Combo Course Certification training classes online.Be a Big Data, Data Science – Combo Course Expert! ✓237 Hrs Learning ✓404 Hrs Projects ✓Life Time Access ✓24 X 7 Support ✓Job Assistance.
Source: Big Data, Data Science – Combo Course Training Classes Online | Big Data, Data Science – Combo Course Courses Online
Recently I wanted to install an application on a Mac, but it required an old version of R (3.2). On Linux and Windows, that is easy, since you install the application on its own path. Now, on a Mac, you can do it as well, but it will require extra work if you build it from source. There is something better!!! Here I outline what you can do easily…
Note that this illustration assumes that you want R 3.2 & 3.3 on the same system and be able to run either of them when you choose.
- Let’s assume that you already installed R 3.3 by downloading it from CRAN.
- To install R 3.2, you will need to download an old version from CRAN old R
- Before installing R 3.2, run the following commands
sudo pkgutil --forget org.r-project.R.mavericks.fw.pkg
sudo pkgutil --forget org.r-project.R.mavericks.GUI.pkg
sudo pkgutil --forget org.r-project.R.mavericks.GUI64.pkg
- Install R 3.2 by double clicking on *.pkg
- Now, download and install RSwitch (RSwitch link), which it will allow you to switch between R version by clicking on the R version of your like.
Installing Multiple Version of R in parallel on the same machine – Mac OS X | R-bloggers
Here’s how to get data from the just-released 2015 American Community Survey using R.
Source: How to download new Census data with R | Computerworld
There are a lot of ranking algorithms for you to use and represent your data. Now, that doesn’t mean that the ranking algorithm is the most appropriate for your situation. It all depends on what you are trying to accomplish and who will be the audience of your final product. Some ranking algorithms could be too sophisticated to be actually understood by a layman’s type of person. The reasoning to develop this particular piece of work was to not only rank specific type of datasets but be able to explain how the ranking is performed for the layman’s type of person.
The inspiration for creating this node came from this site -> http://www.psychstat.missouristate.edu/introbook/sbk14.htm. Now that this node exists, it allows us to reuse it over and over. According to the author of the site, transforming raw scores into percentile ranking, will enable us to: 1) Give us meaning and interpret the scores and 2) Provide a direct comparison between scores.
If you want to learn more and try this extension go to the GitHub Repository. You can find my extension and all others in thePredictive Analytics Gallery.
Source: Missouri State – Score Transfromations
Source: | Ranking algorithm for the layman – New Modeler Extension
Installing rJava on Ubuntu is a piece of cake. All you have to do the code below, and boom!!! You got rJava working in R.
sudo apt-get install openjdk-7-jdk
sudo apt-get install r-cran-rjava
Now, the challenge was trying to get rJava working on RHEL. I could not find any proper documentation that worked. Instead, I ran into a bunch of posts and pointing to things that worked in their environment, but not on mine (so, this might not work on yours as well, but I hope it does). I usually like to give credit to the sources, but this time, they were so many over a long time span, that I could not remember what came from where anymore. So, I apologize for that. Below are the things that I did to get rJava working.
$ sudo yum install gcc-c++ gcc-gfortran R R-core R-core-devel R-devel R-java R-java-devel java-1.7.0-openjdk-devel
$ sudo yum list install gcc*
Once, you have installed the necessary packages; then it is time to
configure your environment
$ sudo /usr/sbin/alternatives --config java #select openjdk
$ sudo /usr/sbin/alternatives --config javac #select openjdk
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-220.127.116.11.x86_64/jre
$ export PATH=$PATH:$JAVA_HOME/bin
$ sudo /usr/bin/R CMD javareconf
> install.packages("rJava") #install rJava on R console
And that is it! If you got the install.packages(“rJava”) to work on R, that means that now you can call Java from within R console.
I finally was able to find a guide that was able to allow me to setup Moodle on 1&1 Shared hosting environment. To me, the only thing that I followed was deactivating “slash arguments” from “http://yourserver/admin/settings.php?section=http” section. Once I did that, then my web HTML 1.0 site, got converted into a web HTML 3.0 (at least).
Thanks for the share!
Source: Installing moodle 2.6 on 1&1 Host » Gistlabs.net
I just recently migrated from Untangle 11.2 to Sophos UTM to give it a ride and noticed that a lot of things are blocked (which is a good thing if you know what you are doing and need to unblock it). Just recently I noticed that I couldn’t make any more calls by using my iPad or Mac through my iPhone. So, continuity was not working like it was before.
I went to the Apple site (see sources), but couldn’t figure out what port or services were the one that needed to be allowed by the firewall. So, after analyzing dropped packages by the firewall, I noticed a pattern and created the following firewall rule. Since the creation of this firewall rule, I haven’t had any more issues with continuity nor downloading content from games in Game Center.
Overall network mapping: Internal network -> Allow ports 6384:16472 -> Any
- Go to “Network Protection”
- Click “New rule…”
- Under “Sources:” add “Internal (Network)”
- Under “Services” (you probably haven’t created this, so we are going to do it the long way), click on the “+” to add a new service
- Give it a name. Probably “Apple Continuity”
- On “Destination port:” allow ports from “16384:16472”
- Under “Comment” add these ports are “Real-Time Transport Protocol (RTP), Real-Time Control Protocol (RTCP)” for “iChat AV (Audio RTP, RTCP; Video RTP, RTCP), FaceTime, and Game Center”
- Click “Save”
- Under “Destinations:” add “Any”
- (Optional) Add comment
- Click “Save”
Now you should be able to use Apple continuity by handing over calls over your iPad and/or Mac from your phone under the same network.
Hopefully Sophos UTM could include this as default with their future releases.
Source: TCP and UDP ports used by Apple software products – Apple Support