compile – set – run mongoose web server in android (emulator)

run web server mongoose in android

G3n1k's Blog

source code mongose
http://mongoose.googlecode.com/files/mongoose-3.8.tgz

ndk android
https://developer.android.com/tools/sdk/ndk/index.html
ndk target 32, for 64bit linux
version: android-ndk32-r10-linux-x86_64.tar.bz2

sdk android
https://developer.android.com/sdk/index.html
sdk for linux

extract ndk to ~/tmp/android-ndk-r10
extract mongoses-3.8 to ~/tmp/mongoose
extract sdk to ~/tmp/android-sdk-linux

#insert this code
include $(CLEAR_VARS)

LOCAL_MODULE    := mongoose
LOCAL_SRC_FILES := main.c mongoose.c

include $(BUILD_EXECUTABLE)

mongoose-jni-file

android-ndk-sources-css-stl-system

if success you will find the file in ~/tmp/mongoose/libs/armeabi

mongoose-execute-file

create and run emulator, emulator api level 18 (because more faster loading)

avd2

run browser to 127.0.0.1:8080 (listening_ports value)
mongoose-android

Lihat pos aslinya

debian 7 install sun java jdk

G3n1k's Blog

install fresh crunchbang, remove all ntfs partition … and  i  stuck at java installed

the method from http://g3n1k.wordpress.com/2014/01/04/crunchbang-waldorf-debian-wheezy-install-java-sunoracle-jdk/ didnt work

google and found this

https://wiki.debian.org/Java/Sun

follow step there and stuck in depedency … at last found this work

before you update, make sure you remove other repository,

open synaptic -> setting -> repositories -> tab Other Software

remove-another-source-repository

now update and install sun java jdk

debian-7-install-sun-java-7after that, remove open jdk

Lihat pos aslinya

intall octave in debian Wheezy, for image processing

G3n1k's Blog

what is octave …

simply word, octave is software for numerical (like MATLAB) but you can use for image processing ( Teori dan aplikasi pengolahan citra – Abdul Kadir)

to install octave in debian wheezy, we must install graphicsmagick first. graphicsmagick use as engine for processing image in octave. we will build graphicsmagick from source, becouse its need option quantum depth min 16bit, and also we will buil octave from source

install all packages needed

download source graphicsmagick from
http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.19/GraphicsMagick-1.3.19.tar.xz/download

extract with your command or gui

install graphicsmagick

Set GraphicsMagick libs path

download octave
ftp://ftp.gnu.org/gnu/octave/octave-3.8.1.tar.gz

configure and install octave

make shortcut in bin, so you can use it as command

install packages images and dependecy so you can play with images
https://www.gnu.org/software/octave/doc/interpreter/Installing-and-Removing-Packages.html

download package from http://octave.sourceforge.net/packages.php
for octave image processing you need these control, general, signal and image package, download that four package

test octave with…

Lihat pos aslinya 18 kata lagi

add new drive / partition linux (virtualbox)

G3n1k's Blog

– add new drive (virtualbox), my new drive is webdisk.qed (8GB)
webdisk

– start linux box
– check mounting hardisk

– check partition

sdb connected

– start fdisk

– check if partition true

– create new partition


– check again

– write partition

– read (again) partition

– check with fdisk

– format partition with ext4 extension

–  create dir for mounting

– mounting otomatis at boot

– change owner to user

– mounting all partition

– check all volume

– test create file

Lihat pos aslinya

www-data read user home folder

move websites folder to home user

G3n1k's Blog

www-data is apache2 user

ub is my user

and you want save your server home folder ex: /home/ub/websites


<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/ub/websites
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/ub/websites/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
LogLevel info
ErrorLog /home/ub/websites/logs/error_ub
CustomLog /home/ub/websites/logs/custom_ub combined
RewriteEngine On
RewriteLog /home/ub/websites/logs/rewrite_ub
RewriteLogLevel…
Alias /doc/ “/usr/share/doc/”
<Directory “/usr/share/doc/”>
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>

Lihat pos aslinya 1 kata lagi

php debug with file logs

php real time file debug

G3n1k's Blog

today i add third-party libraries class, this class stream output file,

because its output stream i cant debug it with show value in browser

i can’t get parameter value in process, and didn’t where error start …

lucky … php can write to file, so we can write value in file log and read it

i use CodeIgniter Framework, so i will show the controller class

first create folder and file

now create class controller

test with browser

call-debugopen the file log

log-debug

and how to real time debug ???

open terminal, go to folder file.log  and type

tail-debug

Lihat pos aslinya

OOP JavaScript #fast-learn