Halaman

Tampilkan postingan dengan label linux. Tampilkan semua postingan
Tampilkan postingan dengan label linux. Tampilkan semua postingan

Selasa, 14 April 2015

Recursively chmod only on directories or files

A Very simple neat trick to chmod the directories/files
chmod 755 $(find /path/to/base/dir -type d)
and
chmod 644 $(find /path/to/base/dir -type f)
alternative: executing one by one, instead..
for files:
sudo find . -type f -exec chmod 644 {} \;
for directories
sudo find . -type d -exec chmod 755 {} \;
And if you are using that chmod, you are likely using that for your web server. Don't forget to install suPHP on apache, and then setup the configuration at /etc/suphp/suphp.conf and on your virtual host(s) add the 
php_admin_flag engine off
suPHP_Engine on

or perhaps using the fast-cgi approach

Cheers! :D

Selasa, 07 Januari 2014

[c++, c#] Journey of cross compiling mono 3.2.5, utilizing ScratchBox2

This one is a tough one, usually i get away compiling just by trial-and-error after successfully compiling the library for the windows target. But compiling this one is very much a challenge.. and then out of curiosity.. here i am writing this blog entry so that someday i could revisit and think .. what the **** am i doing compiling libraries and not doing those projects!

Well if my future me see this post, "I do it because of cross environment, playbook, win 7.5, vala, mono, xna, cocos2dxna, and Pou.. i bet you will understand and remember.. hehe, and yes, i know, it is very silly.. but Y.O.L.O!"

So let's go with it shall we..

After trying to compile using BB NDK SDK version 2.1 i encountered problem with the assembler compilation. If i can recall the error correctly, the message was "invalid operation $03" or something similar like that..

After 2 nights of blackened eyes, i give up and then tried to compile on a virtual machine, for that machine i choose LINUX Mint 15 for the OS, chosen simply because the OS iso file lying around on my hard-disk. For the virtualization, i'm using vmware

I was thinking about using linux because i could simply use ./configure and then make, but i think to myself it would be better if i could directly compile this for the arm architecture, after diving to google, there is a very exciting project callled Scratchbox2, and then here i am using the command

$ sudo apt-get install scratchbox2
$ sudo apt-get install qemu

Then i tried to find linux arm compiler toolchain, for this purpose i search for the file arm2009q1-203-none-linux-gnueabi simply because that is the compiler i used in Windows when venturing with WebOS.. (love that platform.. hixs..)

here is the name of the file i downloaded from codesourcery: arm-2009q1-203-arm-none-linux-gnueabi.bin

What?? you need the web address you say? here it is: http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/

Let's go to the terminal and then type the following..

$ chmod +x arm2009*
$ ./arm2009*

Follow those installation screen with care, i choose to install on default directory.. and that is at $HOME/CodeSourcery

Here is the trick! if i use sb2-init with the -c and without -C -static it will fail to run sb2-build-libtool! don't know about that -c, but if i did not specify -C -static, the compiled will try to find the library linux.so.3, about the -lpthread, that's because when compiling mono, there are undefined references to pthread, so i decided to put that to default.. maybe we should find a cleaner solution to this

Therefore here is the command i use to initialize sb2

$ sb2-init -d -C "-static -lpthread" arm $HOME/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc

$ sb2-init -d arm $HOME/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc

when not using this arm-2009q1-203-arm-none-linux-gnueabi.bin release, for example using built in arm-linux-gnuebi-gcc (from the apt), i failed to run sb2-build-libtool, a workaround would be adding parameter -C "-static" to sb2-init but i guess this would break some build system.. note to self: Need to find-out building custom rootfs! (finger crossed, perhaps copying the libc content? hehe..)

important! you need to init sb2 in $HOME/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc because that is the rootfs for that toolchain

let's try with a simple hello world program shall we..

$ sb2
$ gcc hello.cpp -o hello
$ file hello --> this should show that we have compiled for the arm-architecture! ;)
$ ./hello --> will run!
$ exit ->> this will exit us from the "jail" arm-environment we had setup earlier

Ok, now is the fun part, let's go to the extracted tarball mono source folder, cross your fingers :p and then type

$ sb2
$ ./configure --with-monotouch=no --without-mcs-docs --disable-mono-debugger CFLAGS="-DBROKEN_64BIT_ATOMICS_INTRINSIC -DARM_FPU_NONE" LIBS=-lpthread --disable-mcs-build

The configuration is a success!

But, the potential horror might now came along.. anyway.. let's proceed!

before make! i add the patch to the mono/mini/mini.arm.h
#define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1
change that to
//#define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1

on the same terminal, lets go make some!

$ make
$ make install DESTDIR=$HOME/mymono

there you have it! a compiled mono for arm architecture!

Some hints:

for the mono's ./configure script, to show the options accepted by the configure run
$ ./configure --help

Ps. If you like and learn something from other people, and you can't or don't want to donate to them directly, show your support by sharing the article, google+ing the article, or perhaps checking out the advertisements which may appear on the website ;) many thanks before!







Jumat, 30 November 2012

[Debian VPS]Installing lamp, till bind9

Edited: 29 Jan 2015
To manage this kind of things, let's use a more powerfull thing which is called Webmin. Download the debian package, and then setup Apache Virtual Hosts, and Bind Configuration from there.

side note: when installing bind to the VPS, we should set the DNS Server to 127.0.0.1 (localhost) and then set the bind dns forwarding accordingly.

-----------OLD ARTICLE STARTING-------->>

I was tempted with the low price on vps these days, and it's my goal someday to create a multiplayer game.. err not multiplayer.. but online where people could play and compete with each other online.. ;)

any whoo..

the steps..

  1. After you receive your username, password, and ip address, log in to you vps SSH by ussing putty
  2. Start by upgrading.. aptitude update && aptitude upgrade
  3. Next, install mysql aptitude install mysql-server mysql-client
  4. Enter you mysql username and password, don't lose it
  5. install the server aptitude install apache2 apache2-doc

Jumat, 23 September 2011

Playing with linux

Downloading file : use wget http://blabla.com/bla.zip
working with a tar.gz : tar -zxvf arcieve.tar.gz

since i like to play with installing the development.. this will include the header file XLib.h, XUtil.h
apt-get install xorg-dev

finding some file?
find / -name filename.ext -print

Selasa, 19 Juli 2011