Skip to content

Instantly share code, notes, and snippets.

View codenoid's full-sized avatar

codenoid

  • Wonogiri, Jawa Tengah
  • 23:23 (UTC +07:00)
View GitHub Profile
@codenoid
codenoid / .html
Created April 29, 2017 05:54
Simple Alarm App With Javascript
<!DOCTYPE html>
<html>
<head>
<title>JAM 2 BANGUNIN RUBI</title>
</head>
<body style="background-color: black;">
<center><br><br><br><br><br><br><br><br>
<h1 style="color: white;">JAM 2 PAGI BANGUNIN RUBI</h1>
<h3 style="color: white;">ALARM AKTIF PADA JAM 2 PAGI</h3>
<h4 style="color: white;" id="uh"></h4>
@codenoid
codenoid / basic.php
Created August 2, 2017 02:55
Super basic PHP Backend Dev
<?php
function db($do)
{
// DB Info
$servername = "localhost";
$username = "root";
$password = "ayam";
$dbname = "latihan_blog";
@codenoid
codenoid / server.cr
Created August 13, 2017 01:33 — forked from solisoft/server.cr
multi rooms kemal websockets server
require "kemal"
require "arangocr"
require "json"
connected_sockets = {} of String => Array(HTTP::WebSocket)
connected_users = {} of String => Hash(String, JSON::Any)
def broadcast(data, sockets)
sockets.each do |socket|
socket.send data.to_json
last week had me working on setting a squid proxy server with multiple IP/domains. the plan was to have squid route outgoing traffic to as many IPs that the server carries. the server only has one physical interface. the rest of the IPs are tied to it via aliases or a virtual interface. you can easily do this with the following command:
ifconfig ethX:Y <IP_ADDRESS>
where X is the number of your physical ethernet device, and Y is the number designated (arbitrary) for the virtual interface. you could also add the broadcast and netmask address in the same line as well. so it would look something like this:
ifconfig eth0:1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
for testing, a minimal configuration had the proxy running in no time. it would listen to 2 IPs for incoming HTTP requests on different ports. supposedly it should also route requests in the same IP where it was received. it didn’t. popular web services (ipchicken.com, whatismyip.com, whatismyip.org) for knowing your IP were used and
Changelog Development Documentation Download libcurl Mailing Lists News
cURL / Mailing Lists / curl-users / Single Mail
curl-users
FW: Specifying a IP address to curl
This message: [ Message body ] [ More options ]
Related messages: [ Next message ] [ Previous message ] [ Maybe in reply to ] [ Next in thread ] [ Replies ]
@codenoid
codenoid / mongoso.md
Last active September 20, 2017 09:17
mongo.cr
export LD_LIBRARY_PATH=/usr/lib64/
export LD_RUN_PATH=/usr/lib64
@codenoid
codenoid / mru.md
Created August 27, 2017 08:05
:MRU

Overview

The Most Recently Used (MRU) plugin provides an easy access to a list of recently opened/edited files in Vim. This plugin automatically stores the file names as you open/edit them in Vim.

This plugin will work on all the platforms where Vim is supported. This plugin will work in both console and GUI Vim. This version of the MRU plugin needs Vim 7.0 and above. If you are using an earlier version of Vim, then you should use an older version of the MRU plugin.

@codenoid
codenoid / rubi.md
Last active August 27, 2017 08:26
Rubi's Productivity Starter Pack

Rubi's Productivity Starter Pack

  1. The rooms were busy (not sure)
  2. Bright / Light Space
  3. The room is not noisy
  4. With delicious coffee
  5. Fast internet connection, at least not make me wait until it becomes lazy
  6. A computer with good performance
  7. Still trying to recognize me.. ;)
name: trypapierqt
version: 0.1.0
authors:
- <>
dependencies:
qt5:
github: Papierkorb/qt5.cr
branch: master-ready-to-use
[Unit]
Description=cargo_shorts
Documentation=https://github.com/Fryguy/cargo_shorts/blob/master/README.md
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/cargo_shorts
ExecStart=/opt/cargo_shorts/bin/cargo_shorts -p 80
Restart=on-failure