This is a very simple HTTP server for Unix, using fork(). It's very easy to use
- include header
httpd.h
- write your route method, handling requests.
- call
serve_forever("12913")
to start serving on port 12913
//before | |
Runnable r1 = new Runnable() { | |
@Override | |
public void run() { | |
System.out.println("My Runnable"); | |
} | |
}; | |
//now | |
Runnable r2 = () -> System.out.println("My Runnable"); |
from __future__ import print_function | |
''' | |
Basic Multi GPU computation example using TensorFlow library. | |
Author: Aymeric Damien | |
Project: https://github.com/aymericdamien/TensorFlow-Examples/ | |
''' | |
''' | |
This tutorial requires your machine to have 1 GPU | |
"/cpu:0": The CPU of your machine. |
# Here's your list of choices that would be displayed in a drop-down | |
# element on the web. It needs to be a tuple, and we define this | |
# as a variable just for readability/convenience. | |
# | |
# This example has 3 choices, each of which consists of two parts: | |
# 1. the thing that get strored in your database | |
# 2. the thing that you see in a dropdown list | |
LABEL_CHOICES = ( | |
('this gets stored in your database', 'This item is what you see in the drop-down'), | |
('django', 'Django'), |
#!/usr/bin/env python3.4 | |
#### Nyaundi Brian <ndieksman@gmail.com> | |
from pprint import pprint | |
links_string_from_header='<https://api.github.com/search/users?q=location%3AKenya&page=4>; rel="next",' \ | |
' <https://api.github.com/search/users?q=location%3AKenya&page=34>; rel="last", ' \ | |
'<https://api.github.com/search/users?q=location%3AKenya&page=1>; rel="first", ' \ | |
'<https://api.github.com/search/users?q=location%3AKenya&page=2>; rel="prev"' |
Go to http://www.softether-download.com/files/softether and download SoftEther Client for the right architecture.
> cd /tmp
> wget http://www.softether-download.com/files/softether/v4.18-9570-rtm-2015.07.26-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz
> tar xf softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz
package anim; | |
import java.awt.Dimension; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.io.IOException; | |
import java.net.URL; | |
import javax.imageio.ImageIO; | |
import javax.swing.JFrame; |
package com.company; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Logic 1 | |
* |
// Run this in the F12 javascript console in chrome | |
// if a redirect happens, the page will pause | |
// this helps because chrome's network tab's | |
// "preserve log" seems to technically preserve the log | |
// but you can't actually LOOK at it... | |
// also the "replay xhr" feature does not work after reload | |
// even if you "preserve log". | |
window.addEventListener("beforeunload", function() { debugger; }, false) |
This assumes you are now connected to the server via SSH.
sudo -s
Enter root mode for admin accessgroupadd devgroup
Create new group to be later granted access to /var/www/htmluseradd -G root,devgroup masterdev
Create new root user. Also add to the devgrouppasswd masterdev
Change password for the new root user