How to Setup Sandstorm Personal Cloud Server in Linux

Linux the great

Sandstorm is an Open Source self-hostable web productivity suite implemented as a security-hardened web app package manager. It is a radically easier way to run personal instances of your web application at one place. It allows you to have your own personal server to install multiple application on it through an app store interface as easily as you would install apps on a phone. Sandstorm keeps a list so you can find everything you create and its unified access control system covers data from every app, and everything is private to you by default. Find any app you want on the App Market and start using it with a few clicks. Every app comes with automatic updates. More than all it protects you, each document, chat room, mail box, notebook, blog, or anything else you create is a “grain” in Sandstorm. It containerizes each one in its own secure sandbox…

View original post 1,113 more words

How to Use Linux Hexdump Command with Practical Examples

Linux the great

Hexdump is a very useful Linux command for developers and application debuggers. It has ability to dump file contents into many formats like hexadecimal, octal, ASCII and decimal. This command takes a file, or any standard input, as input parameter and converts it to the format of your choice. Let’s assume you work with binary data and you are unable to understand the format of a file, you can make use of Hexdump command to get file contents in much better readable format. This command comes pre-installed with all modern day Linux operating systems like CentOS, Fedora, Ubuntu, Debian, Arch Linux etc. In this article, we will be demonstrating the use of hexdump command using various examples. Written in C language, this command might be easy to understand by professional C programmers, but for other IT professionals, it might be a tricky command. We will try to do our best…

View original post 902 more words

Pet – A Command Line Snippet Manager for Linux

Linux the great

If you manage a lot of Linux systems via command line, you must be aware of the hectic task to remember all the commands you use on daily basis. You often need to go into your system’s history and find the required commands from there. Pet is a command line based tool which makes a system administrator’s life easy. It is an easy to use snippet manager, which saves your command snippets and you can easily view and use them when needed. Command line junkies find this tool extremely important, it is completely a freeware script, the setup process is pretty simple and it runs on almost all flavors of Linux operating system as well as Mac OS. It is built using the well known Go programming language and requires some python modules like Peco and brew to work properly. It is written by Teppei Fukuda and its source code…

View original post 674 more words

Adventures in Elm

2017-03-19 11_30_53-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_32_58-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_33_50-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_34_13-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_35_14-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_36_25-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_37_32-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_38_15-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_40_16-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_43_29-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_43_59-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_44_31-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player

2017-03-19 11_47_45-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_45_39-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 11_48_41-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player

2017-03-19 11_49_16-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player

You can write your first elm code online here: http://elm-lang.org/examples/hello-html

Your first hello word code will look like this:

import Html 

main =
 Html.text "Hello, World!!"

Your index.html  will look like this:

Hello, World!!

You can also div as follows:

import Html 

main =
 Html.div [] [
 Html.text "Hello, World!!"]

Output will remain the same, but if you inspect the webpage, you can see the following in the source code:

2017-03-19 12_04_08-example_hello-html.png

You can convert your html code to elm here: https://mbylstra.github.io/html-to-elm/

2017-03-19 12_08_33-Photos.png

You can also add a view function

import Html 

main = view

view : Html.Html Never
view = 
 Html.div [] [
 Html.text "Hello, World!!"]

Your output will remain the same.

If you want to output your mouse position your code will look like:

import Html 
import Mouse
import Programmator

main : Program {}
main = {

init = { x=0, y=0 },
input = Mouse.moves,
view = view
} |> Programmator.viewFromOneInput

view : Mouse.Position -> Html.Html Mouse.Position
view { x , y }= 
 Html.div [] [
 Html.text ("x= "++ (toString x) ++ ", y= " ++ (toString y))]

 

2017-03-19 12_40_06-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 12_40_17-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player2017-03-19 12_40_47-GOTO2016•Advent-Download-From-YTPak.com.mp4 - VLC media player

Docker Security

2017-03-19 10_39_45-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_40_30-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_40_45-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_41_21-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_41_31-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_41_44-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

Docker contaniners share the kernel wth the machine they are running on.

2017-03-19 10_44_12-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player.png

If any of the containers starts using up more resources like CPU, RAM the other containers might run ino /do/s issue.

2017-03-19 10_45_35-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player.png

The attack can break out from a container into the host  machine or other containers.

2017-03-19 10_46_35-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player.png

Make sure that the images coming from dockerhub are from trusted sources.

2017-03-19 10_47_30-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

You should be careful with what secrets you store in your containers.2017-03-19 10_47_51-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_48_01-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 10_48_32-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

2017-03-19 10_52_52-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player.png

You can use the commands:

docker network disconnect nh

nh is the name of the container. This will disconnect your containers from the network and they will be inaccessible.

docker diff

Docker diff will show you which files have been modified.

If you do not want external invalid/destructive files to modify your containersthen you can make your containers read-only

2017-03-19 10_56_31-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player.png

Specify –read-only option while running your container.

2017-03-19 11_00_00-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_00_14-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_00_35-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

2017-03-19 11_03_31-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_03_41-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_04_27-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_04_51-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_05_01-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_05_39-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_06_11-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_06_35-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_06_46-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

2017-03-19 11_07_41-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

2017-03-19 11_10_19-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_10_37-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_10_53-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_11_21-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_11_45-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_12_03-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_12_44-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_12_55-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_13_11-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_13_55-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_14_06-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_14_21-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_14_35-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_15_00-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_15_43-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_16_29-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_17_06-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_17_17-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_17_34-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_18_37-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player2017-03-19 11_18_48-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

 

2017-03-19 11_19_44-GOTO2016•Docker-Download-From2-YTPak.com.mp4 - VLC media player

What Is The Shell?

Linux the great

When we speak of the command line, we are really referring to the shell. The shell is a program that takes keyboard commands and passes them to the operating system to carry out. Almost all Linux distributions supply a shell program from the GNU Project called bash. The name “bash” is an acronym for “Bourne Again SHell”, a reference to the fact bash is an enhanced replacement for sh, the original Unix shell program written by Steve Bourne.

Terminal Emulators When using a graphical user interface, we need another program called a terminal emulator to interact with the shell. If we look through our desktop menus, we will probably find one. KDE uses konsole and GNOME uses gnome-terminal, though it’s likely called simply “terminal” on our menu. There are a number of other terminal emulators available for Linux, but they all basically do the same thing; give us access to…

View original post 804 more words

Java 8 coding challenge : Jarvis and Seven Segments

All over the world, peoples are working on energy solution. It would be a tough time for our next generation to survive if we don’t think about solution. Tony stark is working on a new project and wants to display his project using “seven segment display – concept”. Tony Stark gave Jarvis a task to find a number from his Favorite list of number for which the energy consumption is lowest.

(Assuming that for a digit to represent Tony stark is using 7 bulbs and only those bulbs light up which are required to represent a number and rest other would be completely off.)

Help Jarvis and conserve energy.

Seven segment display – https://en.wikipedia.org/wiki/Seven-segment_display

enter image description here

Input:
First line will contain the number of test cases and for every test case first line will contain length of favorite list and the second line for a test case will contain n numbers

Output:
For every test case print the answer. If there exist more than 1 numbers for which same number of bulbs are required than output the number which occurs first in the Favorite list.

Constraints:
Test cases< 10
A[i] < 10^6
Size of list < 10^5

SAMPLE INPUT
1
5
1 2 3 4 5
SAMPLE OUTPUT
1
Explanation

Number 1 needs only two bulbs to represent.

Code:

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
 
 
 
 
public class Solution {
 
 
 public static void main(String args[]) throws IOException{
 InputReader in=new InputReader(System.in);
 PrintWriter out=new PrintWriter(System.out);
 int T=in.readInt();
 
 while(T-->0){
 long N=in.readLong();
 long min=222222222;
 long minnum=0;
 while(N-->0){
 long num=in.readCount();
 long count=in.getcount();
 if(count<min){
 min=count;
 minnum=num;
 }
 }
 out.println(minnum);
 out.flush();
 
 }
 
 out.close();
 
 }
}
 
class InputReader{
 InputStream in;
 int[] segment={6,2,5,5,4,5,6,3,7,6};
 long count=0;
 InputReader(InputStream in){
 this.in=in;
 }
 
 public long getcount(){
 return count;
 }
 private int read() throws IOException{
 return in.read();
 }
 
 
 
 public char readChar() throws IOException{
 int n=read();
 while(isWhiteSpace(n)){
 n=read();
 }
 return (char)n;
 }
 
 public int readInt() throws IOException{
 int number=0;
 int n=read();
 while(isWhiteSpace(n)){
 n=read();
 }
 while(!isWhiteSpace(n)){
 int integer=n-'0';
 number*=10;
 number+=integer;
 n=read();
 }
 return number;
 }
 
 public long readCount() throws IOException{
 long number=0;
 count=0;
 int n=read();
 while(isWhiteSpace(n)){
 n=read();
 }
 while(!isWhiteSpace(n)){
 int integer=n-'0';
 count+=segment[integer];
 number*=10;
 number+=integer;
 n=read();
 }
 return number;
 }
 
 
 public long readLong() throws IOException{
 long number=0;
 int n=read();
 while(isWhiteSpace(n)){
 n=read();
 }
 while(!isWhiteSpace(n)){
 int integer=n-'0';
 number*=10;
 number+=integer;
 n=read();
 }
 return number;
 }
 
 private boolean isWhiteSpace(int n){
 if(n=='\n'||n=='\r'||n=='\t'||n==' '||n==-1){
 return true;
 }else{
 return false;
 }
 
 }
 }