Skip to content

Instantly share code, notes, and snippets.

View codenuke's full-sized avatar

C0deNuke codenuke

View GitHub Profile
#!/bin/sh /etc/rc.common
START=10
start()
{
uci set wireless.sta.disabled='0'
uci commit
/etc/init.d/network restart
sleep 30
echo '#!/bin/sh' > /tmp/autologin.sh
echo 'count=$(ping -c5 -w5 8.8.8.8 | grep "100% packet loss" | wc -l)' >>/tmp/autologin.sh
echo 'if [ "$count" -gt 0 ]; then' >> /tmp/autologin.sh
echo ' wget -O /dev/null "http://172.168.1.1/CheckValidUser.php?username=c4&password=xxxx"' >> /tmp/autologin.sh
echo ' echo "autologin start"' >> /tmp/autologin.sh
echo 'fi' >> /tmp/autologin.sh
echo '-------'
chmod +x /tmp/autologin.sh
echo '#!/bin/sh' > /tmp/check_autologin.sh
echo 'START=$(date +%s)' >> /tmp/check_autologin.sh
/**
* Get ESP8266 infomation.
* @Author AppStack.CC
* @Website http://www.appstack.cc
*/
#include <ESP8266WiFi.h>
// Thank K.Settakan Suwannawat for explain flash chip id. https://www.facebook.com/groups/ChiangMaiMakerClub/permalink/781221611997934/
// Find flash chip from http://code.coreboot.org/svn/flashrom/trunk/flashchips.h
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
@codenuke
codenuke / find_day_of_week.php
Last active August 29, 2015 14:04
Find day of week in date range.
<?php
$start_date = new DateTime('2014-07-01'); // Create Start Date
$end_date = new DateTime('2014-07-31'); // Create End Date
$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($start_date , $interval, $end_date);
$day_of_week = array();
foreach ($period as $dt)
{
$day_of_week[] = $dt->format("N");
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/theme product.css">
<link rel="stylesheet" type="text/css" href="css/cssmenu.css">
<link rel="stylesheet" type="text/css" href="css/work.css">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/theme product.css">
<link rel="stylesheet" type="text/css" href="css/cssmenu.css">
<link rel="stylesheet" type="text/css" href="css/work.css">
@codenuke
codenuke / kinematics_template.cs
Created May 20, 2014 06:08
Kinematics Template
public void ScaraForward(double j1,double j2 ,double j3 )
{
double x;
double y;
double z;
// Convert joint value to postion
}
public void TestApi()
{
string url = "https://api.github.com/repos/Svl2Nuk3/jtable";
var client = new RestClient(url);
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
var content = response.Content;
Console.WriteLine(content.ToString());
}
@codenuke
codenuke / path_mcrypt.bash
Created May 15, 2014 09:14
Fix requires the Mcrypt PHP extension.
# Step 1
cd ~
# Step 2
vi .bash_profile
# Step 3 : Insert this line and chage php path.
export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH
# Step 4 Save File => :wq