I guess he's dole'n it up bro. Come back in a month.
http://nodejs.org
Friday, September 10, 2010
There Ain't No Such Thing As Plain Text
This article definitely shines some like on character encodings. Especially UTF-8 and Unicode.
"It does not make sense to have a string without knowing what encoding it uses."
http://www.joelonsoftware.com/articles/Unicode.html
You have no choice but to read it or it will come back to haunt you if you don't. I'm not kidding. If you say you already know, then I say read it anyway. Wait, let me say it in not a rude way. Can you please, pretty please read this page so you don't screw yourself later on in your code.
I can think of a few instances where my code came back to haunt me when I didn't use a charset/encoding or used the wrong one. Learn from your mistakes, or better yet. Learn from others'.
"It does not make sense to have a string without knowing what encoding it uses."
http://www.joelonsoftware.com/articles/Unicode.html
You have no choice but to read it or it will come back to haunt you if you don't. I'm not kidding. If you say you already know, then I say read it anyway. Wait, let me say it in not a rude way. Can you please, pretty please read this page so you don't screw yourself later on in your code.
I can think of a few instances where my code came back to haunt me when I didn't use a charset/encoding or used the wrong one. Learn from your mistakes, or better yet. Learn from others'.
Wednesday, September 8, 2010
How to whet your Python and HTML5
Dive into Python by Mark Pilgrim, you can read the full thing online or buy the book.
Join the mailing list, but before you do so I would highly recommend you read dive into python first.
I personally like Python more than any other language I've worked with. It is more of a wrapper language thou. Meaning It's a good multi-platform language that you can develop code that can use other languages as well. You can write you heavy lifting in C/C++ or Java or C# and then use those libraries in python. It's so awesome in fact, that I was left speechless for a while during learning this language in the beginning.
Mark Pilgrim also wrote Dive into HTML5. BTW, If your doing any HTML5 dev work then you need to checkout HTML5Boilerplate which is done by Paul Irish.
Happy coding to you all.
Join the mailing list, but before you do so I would highly recommend you read dive into python first.
I personally like Python more than any other language I've worked with. It is more of a wrapper language thou. Meaning It's a good multi-platform language that you can develop code that can use other languages as well. You can write you heavy lifting in C/C++ or Java or C# and then use those libraries in python. It's so awesome in fact, that I was left speechless for a while during learning this language in the beginning.
Mark Pilgrim also wrote Dive into HTML5. BTW, If your doing any HTML5 dev work then you need to checkout HTML5Boilerplate which is done by Paul Irish.
Happy coding to you all.
exporting bash aliases and functions into a variable
I'm getting a little git gist happy. :) So here's something just for kicks. I'm gonna start posting other things than bash. Perhaps more python and php code. ATM I'm reading "JavaScript: The Good Parts" I highly recommend this book, it's a good read. Been meaning to read it for a while to brush up on my js coding skills, because I plan on doing a lot of nodejs development here in the near future for a import/export system.
running aliases and functions with sudo, and Blogger bashing
I don't remember where I got this like 3 years ago. Just thought I'd share it because it's very useful. Maybe it will be as useful for you as it is for me.
Blogger seems to always mess up my indentations. So it's not really good for python code. However, this is a bash function to wrap aliases and functions in sudo. I wish blogger wouldn't do that. But wait folks that's not all. It assists me in losing changes too. Gotta love that. If you see me switch over to posterous or not blog on here anymore, then you will know why. Not much incentive to use a system that screws with your text or text formating. hahaha, even Gov. Arnold has a posterous.
Better yet I will place code in a gist and keep ranting :) (I'll leave the below function declaration so you can see how ugly it looks)
sudo ()
{
local c o t parse
# Parse sudo args
OPTIND=1
while getopts xVhlLvkKsHPSb:p:c:a:u: t; do
if [ "$t" = x ]; then
parse=true
else
o="$o -$t"
[ "$OPTARG" ] && o="$o $OPTARG"
fi
done
shift $(( $OPTIND - 1 ))
# If no arguments are left, it's a simple call to sudo
if [ $# -ge 1 ]; then
c="$1";
shift;
case $(type -t "$c") in
"")
echo No such command "$c"
return 127
;;
alias)
c=$(type "$c"|sed "s/^.* to \`//;s/.$//")
;;
function)
c=$(type "$c"|sed 1d)";\"$c\""
;;
*)
c="\"$c\""
;;
esac
if [ -n "$parse" ]; then
# Quote the rest once, so it gets processed by bash.
# Done this way so variables can get expanded.
while [ -n "$1" ]; do
c="$c \"$1\""
shift
done
else
# Otherwise, quote the arguments. The echo gets an extra
# space to prevent echo from parsing arguments like -n
# Note the lovely interactions between " and ' ;-)
while [ -n "$1" ]; do
c="$c '$(echo " $1"|sed -e "s/^ //" -e "s/'/'\"'\"'/")'"
shift
done
fi
# Run the command with verbose options
echo Executing sudo $o -- bash -x -v -c "$c" >&2
command sudo $o bash -xvc "$c"
else
echo sudo $o >&2
command sudo $o
fi
}
Blogger seems to always mess up my indentations. So it's not really good for python code. However, this is a bash function to wrap aliases and functions in sudo. I wish blogger wouldn't do that. But wait folks that's not all. It assists me in losing changes too. Gotta love that. If you see me switch over to posterous or not blog on here anymore, then you will know why. Not much incentive to use a system that screws with your text or text formating. hahaha, even Gov. Arnold has a posterous.
Better yet I will place code in a gist and keep ranting :) (I'll leave the below function declaration so you can see how ugly it looks)
sudo ()
{
local c o t parse
# Parse sudo args
OPTIND=1
while getopts xVhlLvkKsHPSb:p:c:a:u: t; do
if [ "$t" = x ]; then
parse=true
else
o="$o -$t"
[ "$OPTARG" ] && o="$o $OPTARG"
fi
done
shift $(( $OPTIND - 1 ))
# If no arguments are left, it's a simple call to sudo
if [ $# -ge 1 ]; then
c="$1";
shift;
case $(type -t "$c") in
"")
echo No such command "$c"
return 127
;;
alias)
c=$(type "$c"|sed "s/^.* to \`//;s/.$//")
;;
function)
c=$(type "$c"|sed 1d)";\"$c\""
;;
*)
c="\"$c\""
;;
esac
if [ -n "$parse" ]; then
# Quote the rest once, so it gets processed by bash.
# Done this way so variables can get expanded.
while [ -n "$1" ]; do
c="$c \"$1\""
shift
done
else
# Otherwise, quote the arguments. The echo gets an extra
# space to prevent echo from parsing arguments like -n
# Note the lovely interactions between " and ' ;-)
while [ -n "$1" ]; do
c="$c '$(echo " $1"|sed -e "s/^ //" -e "s/'/'\"'\"'/")'"
shift
done
fi
# Run the command with verbose options
echo Executing sudo $o -- bash -x -v -c "$c" >&2
command sudo $o bash -xvc "$c"
else
echo sudo $o >&2
command sudo $o
fi
}
rants about stuff and CourtesyFlush
I haven't blogged in a while. So, ummm. I really am not sure what to blog about. It kinda seems like an old fad for me to blog. I just like to mostly read what others have to say and learn from others. It's nice to give back though. I like to give back. Just I do it in a lot of other ways.
So I am still looking for a good job. I can't believe this has to be so difficult. Most places never give me a chance though. It's the recruiters that are the problem, because they aren't programmers looking to hire programmers. What ends up happening is they find someone that knows not a lot, but knows how to talk and brown-nose better than me. I wish to be interviewed by actual people that know what is going on. Not ones you can read about on TheDailyWTF. This is mostly the case when it comes to windows users. I laugh at windows. Because IT IS garbage. Ofcourse this is my personal opinion. I just prefer Linux. Not that I wouldn't write code on it or for it. Because it does get the job done, and in the end thats all that really matters. I'm sure my prayers will be answered though. I believe it with all my heart, brain and soul :)
I been running my computer business for a while now. It's not bad. Definitely beats working for someone else. That all depends on the conditions though. I love to work. It helps me deal.
A little while back I started another project. I have roughly 1000 bash aliases and functions now. It becomes very cumbersome to manage all those. So I created a little pyGTK application with quickly. I called it CourtesyFlush. It's on Launchpad. It scratches my itch. I added a bunch of code in there preparing for some new function in parsing the files and stuff like that. So look beyond that. I basically built it like junk. Because It's how I find out where to go with it. Once I figure out what features it requires I will rethink and OOP the code. I call it progressive building. Like climbing a ladder. As you climb up the ladder you progress up the ladder.
About the logo.

Yes, that is a toilet. Yes, that is python floating in the toilet. Yes, it looks like dung. Yes, It's funny to me, I find it amusing. I love python. It's an awesome language. I made the logo using InkScape (a opensource vector graphics application like Adobe Illustrator). Moving on.
I honestly barely ever use this application. Just once in a while. Mostly I just go with vim, nano, pico, cat or gedit.
Here are some of the current features this program has.
list functions and aliases and show source in a sourceview
display vte console to run aliases and functions
autorun and repeat running of aliases and functions up to 9999 times, no kidding(basically it just wraps your command in a for loop, no biggie. still saves even more time though)
and many more...
heres a screenshot(theres no guarantee this image will stay up)

Here are some features I still plan on adding at some point in time.
OliveGTK's gannotate
tilda's keybindings
commandlinefu in search
tabbed vte console
tabbed sourceview
and many more I can't remember atm...
This program is actually nothing really big. At least I don't think of it as a big deal. It just saves me some time at times.
If you like this program, let me know. If you find any bugs, let me know. If you want me to add more features, let me know. If you want to help, let me know. Anything else? let me know. Honestly, If you find bugs or something I expect you to try to fix it yourself. I may take a long while to fix it, depending on some life variables and such. If it pays though it'll get fixed 10 minutes ago. :) Like with anything else. Don't expect me to do any hand holding, unless it is your breast. haha, just kidding.
I like to know stuff, If you haven't figured it out yet. Knowledge is power, I thrive on that stuff. It's like food, only for my brain.
A lot of things in life are hit and miss. To make good stuff, you have to make a lot of garbage. Plus sometimes you may think something is so awesome that everyone needs or wants it, and the reality is that's not the case. Yet, sometimes you may do something as the spur of the moment and it'll get so much attention that it blows your mind. Anyway, I have nothing more to say now. Back to reading and learning more stuff.
English is not my primary/native language. Which means that you may get insulted. If you can get passed that though then more power to you. There's more important things to worry about than proper wording, pronunciation or the arrangement of words, IMHO. Some may say otherwise. Liba/Riba, same thing.
So I am still looking for a good job. I can't believe this has to be so difficult. Most places never give me a chance though. It's the recruiters that are the problem, because they aren't programmers looking to hire programmers. What ends up happening is they find someone that knows not a lot, but knows how to talk and brown-nose better than me. I wish to be interviewed by actual people that know what is going on. Not ones you can read about on TheDailyWTF. This is mostly the case when it comes to windows users. I laugh at windows. Because IT IS garbage. Ofcourse this is my personal opinion. I just prefer Linux. Not that I wouldn't write code on it or for it. Because it does get the job done, and in the end thats all that really matters. I'm sure my prayers will be answered though. I believe it with all my heart, brain and soul :)
I been running my computer business for a while now. It's not bad. Definitely beats working for someone else. That all depends on the conditions though. I love to work. It helps me deal.
A little while back I started another project. I have roughly 1000 bash aliases and functions now. It becomes very cumbersome to manage all those. So I created a little pyGTK application with quickly. I called it CourtesyFlush. It's on Launchpad. It scratches my itch. I added a bunch of code in there preparing for some new function in parsing the files and stuff like that. So look beyond that. I basically built it like junk. Because It's how I find out where to go with it. Once I figure out what features it requires I will rethink and OOP the code. I call it progressive building. Like climbing a ladder. As you climb up the ladder you progress up the ladder.
About the logo.

Yes, that is a toilet. Yes, that is python floating in the toilet. Yes, it looks like dung. Yes, It's funny to me, I find it amusing. I love python. It's an awesome language. I made the logo using InkScape (a opensource vector graphics application like Adobe Illustrator). Moving on.
I honestly barely ever use this application. Just once in a while. Mostly I just go with vim, nano, pico, cat or gedit.
Here are some of the current features this program has.
list functions and aliases and show source in a sourceview
display vte console to run aliases and functions
autorun and repeat running of aliases and functions up to 9999 times, no kidding(basically it just wraps your command in a for loop, no biggie. still saves even more time though)
and many more...
heres a screenshot(theres no guarantee this image will stay up)

Here are some features I still plan on adding at some point in time.
OliveGTK's gannotate
tilda's keybindings
commandlinefu in search
tabbed vte console
tabbed sourceview
and many more I can't remember atm...
This program is actually nothing really big. At least I don't think of it as a big deal. It just saves me some time at times.
If you like this program, let me know. If you find any bugs, let me know. If you want me to add more features, let me know. If you want to help, let me know. Anything else? let me know. Honestly, If you find bugs or something I expect you to try to fix it yourself. I may take a long while to fix it, depending on some life variables and such. If it pays though it'll get fixed 10 minutes ago. :) Like with anything else. Don't expect me to do any hand holding, unless it is your breast. haha, just kidding.
I like to know stuff, If you haven't figured it out yet. Knowledge is power, I thrive on that stuff. It's like food, only for my brain.
A lot of things in life are hit and miss. To make good stuff, you have to make a lot of garbage. Plus sometimes you may think something is so awesome that everyone needs or wants it, and the reality is that's not the case. Yet, sometimes you may do something as the spur of the moment and it'll get so much attention that it blows your mind. Anyway, I have nothing more to say now. Back to reading and learning more stuff.
English is not my primary/native language. Which means that you may get insulted. If you can get passed that though then more power to you. There's more important things to worry about than proper wording, pronunciation or the arrangement of words, IMHO. Some may say otherwise. Liba/Riba, same thing.
Tuesday, November 17, 2009
Codeigniter 1.7.2 and userauth 0.9.2t7
Been a long time since i wrote anything to this blog. Good thing for all you Codeigniter fans this quick post is about userauth. UserAuth is a simple ACL(Access Control List) Login for CI (CodeIgniter).
To complete a successful install of userauth version 0.9.2t7 just copy the files into your bare codeigniter install. It's safe to copy all files in all the folders in your application folder. Except for the config folder, all the files in this folder you have to merge with your install. You would only have to worry about this if ci version your using is very new and has new variables.
Once you merge all the files in the application/config folder you need to edit the file models/user_group_model.php
In the user_group_model you only need to replace all instances of "use_table" (without quotes) with "from" (also without quotes).
That's it. You should have a working install of ci userauth mini-app. This process should actually work with any version. You just have to merge the code and files. Enjoy.
To complete a successful install of userauth version 0.9.2t7 just copy the files into your bare codeigniter install. It's safe to copy all files in all the folders in your application folder. Except for the config folder, all the files in this folder you have to merge with your install. You would only have to worry about this if ci version your using is very new and has new variables.
Once you merge all the files in the application/config folder you need to edit the file models/user_group_model.php
In the user_group_model you only need to replace all instances of "use_table" (without quotes) with "from" (also without quotes).
That's it. You should have a working install of ci userauth mini-app. This process should actually work with any version. You just have to merge the code and files. Enjoy.
Sunday, March 15, 2009
python append all subdirectories to sys.path
This is my pather class. It appends/prepends the application subdirectories to sys.path
#!/usr/bin env python
#
# -*- coding: UTF-8 -*-
#
# PyNutButter BETA Version 0.1.0.1
#
# Copyright 2009 - Infinity and Beyond by Alex Goretoy, All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# SEE ALSO LICENSE FILE IN PROJECT ROOT DIRECTORY
#
__author__ = "Aleksandr Ilyich Goretoy"
__status__ = "beta" #production
__version__ = "0.1.0.1"
__date__ = "14 March 2009"
import os
import sys
class _pather(object):
def __init__(self,cwd="",send="append",depth=0,height=1):
"""
pwd - directory to get listing from
send - append or prepend to sys.path
depth - 0 is current dir, 1 is next level directory
height - root, dirs, files
"""
self.path=[]
self._path=[]
self.send=send
if cwd is not "":
self.set_paths(cwd,send,depth,height)
return None
def append(self,path):
for i in range(len(sys.path)):
try:
if str(path) == str(sys.path[i]):
if sys.path.index(path)>0:
del sys.path[i]
except(ValueError,IndexError):
pass
self._path=self.path
self.path=path
return sys.path.append(str(self.path))
def prepend(self,path):
for i in range(len(sys.path)):
if str(path) == str(sys.path[i]):
del sys.path[i]
self._path=self.path
self.path=path
return sys.path.prepend(str(self.path))
def set_path(self,value,prepend="",append=""):
self.pathstr="%s/%s/%s"%(prepend,value,append)
if self.send == "append":
self.append(self.pathstr)
else:
self.prepend(self.pathstr)
def set_paths(self,pwd,send="append",depth=0,height=1):
self.send=send
self.pathlist= list( ( (root,dirs,files) for root, dirs,files in os.walk(pwd) ) )[depth][height]
if self.send == "append":
list((self.append("%s/%s"%(pwd,x)) for x in self.pathlist if not x.startswith(".")))
else:
list((self.prepend("%s/%s"%(pwd,x)) for x in self.pathlist if not x.startswith(".")))
python append application working directories subdirectory to sys.path
This is a little script to show how to append the application working directories subdirectories when os.environ['PWD'] _not_ in application directory
doing only os.environ['PWD'], os.get_cwd() or os.path.dirname is _not_ enough and will cause errors in your application if a user opens it in different directory than where the script is
#!/usr/bin/env python
import os,sys
print __file__
print os.environ["PWD"]
s=os.environ["PWD"]+"/"+os.path.dirname(__file__)
sys.path.append(s+"/python_stdout_colors")
print sys.path
doing only os.environ['PWD'], os.get_cwd() or os.path.dirname is _not_ enough and will cause errors in your application if a user opens it in different directory than where the script is
Tuesday, January 27, 2009
yahoo session cookie generator
gammarays has release a paper and a video showing proof of concept on how to bypass yahoo security by simply generating his own cookie and totally leaving login.yahoo.com out of the picture.....If you own a yahoo account, then this may be of a concern to you.....Doesn't surprise me that something like this would happen to another microsoft shop...seeing as this is only one layer user authentication....Security matters...I hope they resolve this issue faster than I can finish playing bee on guitar hero...Who needs to hijack cookie when you have yahoo cookie generator, eh...Next we should see viruses and spam coming from your trusty contacts... Just like CAPTCHA, I tell you. It's not in the algo you use to construct the image. It's in how you present it to the user that determines it's strength.
edited:
video:
milw0rm.com/video/watch.php?id=84
paper:
milw0rm.com/papers/270
more on this from Rizki:
ilmuhacking.com/web-security/yahoo-session-cookie-generator/
edited:
video:
milw0rm.com/video/watch.php?id=84
paper:
milw0rm.com/papers/270
more on this from Rizki:
ilmuhacking.com/web-security/yahoo-session-cookie-generator/
Saturday, January 24, 2009
learn dd command
nice thread about dd command.....check it
linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
If you want a good book on this subject also check out File System Forensic Analysis by Brian Carrier (creator of TSK)
No sense in me, doubling someones efforts...
linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
If you want a good book on this subject also check out File System Forensic Analysis by Brian Carrier (creator of TSK)
No sense in me, doubling someones efforts...
Thursday, January 1, 2009
SSL broken! Hackers create rogue CA certificate using MD5 collisions
Wow, what a way to start the new year.
It was a matter of time before SSL would be broken.
It's about time. Will be interesting to see what will come of this.
blogs.zdnet.com/security/?p=2339
HAPPY 2009!
It was a matter of time before SSL would be broken.
It's about time. Will be interesting to see what will come of this.
blogs.zdnet.com/security/?p=2339
HAPPY 2009!
Sunday, December 7, 2008
How To Convert PDF Document To Images and Vice Versa
To Convert PDF to JPG:
convert some.pdf some.jpg
# this will create some.jpg.PAGE# for each page in the PDF
Alternately if you want custom naming scheme:
convert some.pdf some%03d.png
# this will create somePAGE#.png
To create PDF out of multiple image in a directory:
cd img_dir && convert *jpg some.pdf
#places each image on it's own PAGE
If you need more info than this don't stop Googling.
convert some.pdf some.jpg
# this will create some.jpg.PAGE# for each page in the PDF
Alternately if you want custom naming scheme:
convert some.pdf some%03d.png
# this will create somePAGE#.png
To create PDF out of multiple image in a directory:
cd img_dir && convert *jpg some.pdf
#places each image on it's own PAGE
If you need more info than this don't stop Googling.
How to By-Pass Stats/Tracking Systems
There are a number of ways that one can bypass statistics and user tracking systems that are in use on alot of websites these days. Most systems that employ user tracking either do it via the url/uri string,1x1 pixel images,web server logs, etc...
1. Use lynx/links/links2 for browsing web pages. (This won't load any images and browsing experience is not the same, but you can still see text, which is the most important part anyway)
2. Disable JS(NoScript/FlashBlock) and showing of images in browser. If you use Firefox Web Browser you can find Extensions that will block those pesky 1x1 tracker images for you. AdBlock
3. Pay Attention on what you click and instead off clicking on a link. copy/paste it with minor modifications(removal of a unique id off some sort or something)
4. Modify your User Agent string in your browsers configuration.
5. Use a proxy. There are plenty of proxy lists out there for you to use. Be sure to check the RBL for the proxy you use or you may have problems with accessing some sites/services since they may check proxies ip in RBL. Yes, spammers use proxies to send spam, but so do people that don't send spam and want a little anonymity.
6. Disable cookies. NOTE: Not all sites will work without cookies. You may want to disable cookies on a per site/domain bases. eg. regex.
7. Delete cookies when changing IP or moving to different proxy, etc...
Also:
Make sure to protect yourself with Firefox Addons (Noscript, LocalRodeo, RequestPolicy)
Of course this is not full proof and really depends on the tracking system at hand. If you would like to comment I would appreciate any more ways/ techniques to bypass tracking and stats systems.
Enjoy!
1. Use lynx/links/links2 for browsing web pages. (This won't load any images and browsing experience is not the same, but you can still see text, which is the most important part anyway)
2. Disable JS(NoScript/FlashBlock) and showing of images in browser. If you use Firefox Web Browser you can find Extensions that will block those pesky 1x1 tracker images for you. AdBlock
3. Pay Attention on what you click and instead off clicking on a link. copy/paste it with minor modifications(removal of a unique id off some sort or something)
4. Modify your User Agent string in your browsers configuration.
5. Use a proxy. There are plenty of proxy lists out there for you to use. Be sure to check the RBL for the proxy you use or you may have problems with accessing some sites/services since they may check proxies ip in RBL. Yes, spammers use proxies to send spam, but so do people that don't send spam and want a little anonymity.
6. Disable cookies. NOTE: Not all sites will work without cookies. You may want to disable cookies on a per site/domain bases. eg. regex.
7. Delete cookies when changing IP or moving to different proxy, etc...
Also:
Make sure to protect yourself with Firefox Addons (Noscript, LocalRodeo, RequestPolicy)
Of course this is not full proof and really depends on the tracking system at hand. If you would like to comment I would appreciate any more ways/ techniques to bypass tracking and stats systems.
Enjoy!
Thursday, November 6, 2008
Load different application based on ip address in CI(CodeIgniter)
You can modify the default index.php that comes with codeigniter to load a different application based on ip address. Why would I want to do that? You ask. Well, this would allow you to host the main application on a single internal server. While allowing your other servers that face client application. What this means is that you can create the meat of multiple different sites/domain and host them on the one. Then you can access this internal server from the childs and they will display data to the clients. Basically you would create a domain/site, host one file on it to get site based on domain and other options and display it to client. You can also create some basic caching capability.
Add this basic code in your index.php file:
Add this basic code in your index.php file:
if($_SERVER["REMOTE_ADDR"]=="192.168.1.5")Of course you could create an array and setup multiple domains with the index.php file that receives the site and sends it to the client. Everything would go thru the uri string and you can implement a highly encrypted string and licensing to the internal server with all apps on it. Then just make sure that same index.php file is on all supported domains. :)
$application_folder = "app";
else
$application_folder = "application";
Templated Modulated CMS
GOOGLE IT!
#1
Templated Modulated CMS
BACK IN BUSINESS(CMS project is resuming)
This PHP project partly taking place on codeigniter forum(I need to update my current public code in forum). This project utilizes CodeIgniter, ModularExtensions, Smarty Template System and CodeIgniter Views give you much power in accessing and passing/placing data. Custom Smarty Functions, Custom Modules. Template Management(Public Online Project is not current with my Client Templates). There are still alot more things I can do to compliment the Project Online. Documentation/User Guide, Examples, Public CODE still need update. Looking To GET PAID to write a complete Templated Modulated CMS for YOU. Possible to turn into eCommerce Application with little work of adding features. I started using Code Igniter for fun, in year 2005.Possible to make multiple domains/sites access single primary domain for multiple sites(done in background), also utilize cache. There alot of options in how you can utilize this project in your business/project needs. With some custom coding you can make random or default template showup. It's easy to take any Free Template Online and Split it up in to this CodeIgniter Application smarty/ci views.
sample _template_theme function which loads css and/or js data from db or file system(based on config)

tmcms has support for custom built modules

Allows you to mix Smarty and PHP syntax together in template views stored in db or filesystem

Dynamic Server Configuration

Module Method Mapping, This function maps all uri variables to appropriate modules and methods

A Simple Content Template

Basic Template Theme Function

Loading Template / Themes From FileSystem

Multi-Language Support - Store Language Variable in flat Files or Database

Custom Smarty Functions

generic views that loads all parsed smarty code
Tuesday, November 4, 2008
gconf-editor
gconf-editor: like regedit for gnome, open it from terminal by typing gconf-editor I wasn't able to find a clickable item from menu to get this. Not that you can't add it. Yeah this is some real basic stuff isn't it? Well who cares. I didn't know about it before. I came from a KDE/Slackware background to Gnome/Ubuntu. Change is good.
Enable horizontal scroll for mouse pad:
/desktop/gnome/peripherals/mouse/pad_horiz_scroll
Enable horizontal scroll for mouse pad:
/desktop/gnome/peripherals/mouse/pad_horiz_scroll
gedit as a powerful web development tool
All I have to say is WOW. I wish I knew this earlier. I was messing around with gedit's external tools and came to a stump when trying to configure external tools to do svn commit for me. What did I do? I googled about it and found this great article on configuring gedit for development. Now I can use this tool more effectively than what I have been using(kwrite,kate,stock gedit configuration and screem). I have to say that gedit is by far the best one. Plus you can create python plugins to run inside of it. I think my dreams have just come true. :) Now that I think about it. About the only thing gedit can't do is cook, clean and drive my car. Who knows maybe one day it will. Ah, whatever. You should read this great article though. It can make development on linux with less headaches. Dreamweaver? whats that?
You can find the article here:
micahcarrick.com/09-29-2007/gedit-html-editor.html
This is my external tool I came up with to do svn commit from gedit. Currently you need to type the file to commit or a . (dot) to commit whole directory. Maybe someone knows how to fix this mistake. But it works for now so I have to stick with it until I fix it. Yay, now I can commit from gedit. :) The file is below. You can place this file in ~.gnome2/gedit/tools/ and use it as an extenal tool or in gedit goto tools->external tools and type it in manually, minus comments after shebang.
file: svn-commit
EDIT:
Okay, I fixed it after looking at the commit log. Use this one below and not the one above since it's the new updated version that allows you to commit changes to svn repository from gedit. I don't know why I had to say that. But there you go. Notice the dot on the end. Although, you may want to change it to commit a single file instead of the cwd. If so then you can use $GEDIT_CURRENT_DOCUMENT_PATH instead. Just as a note for all my readers. I use my blog posts as a reminder for me for how I did certain things so that I don't have to re-google and re-research my finding again.
you might also want this as well:
It's also not very hard to run python from external tools as well. See example below:
After having learned this about gedit. I have a feeling that I'm going to dwell on it alot more and come up with some plugins hopefully. That depends on how swamped I am with everything else though. Look for plugins in the near future. Hopefully one that can cook and clean. hehehe, jk. :)
You can find the article here:
micahcarrick.com/09-29-2007/gedit-html-editor.html
This is my external tool I came up with to do svn commit from gedit. Currently you need to type the file to commit or a . (dot) to commit whole directory. Maybe someone knows how to fix this mistake. But it works for now so I have to stick with it until I fix it. Yay, now I can commit from gedit. :) The file is below. You can place this file in ~.gnome2/gedit/tools/ and use it as an extenal tool or in gedit goto tools->external tools and type it in manually, minus comments after shebang.
file: svn-commit
#!/bin/sh
# [Gedit Tool]
# Comment=svn commit
# Name=svn commit
# Shortcut=F11
# Applicability=all
# Output=output-panel
# Input=document
svn ci -m exec `zenity --entry --title="Commit" --text="Enter Commit Message"`
EDIT:
Okay, I fixed it after looking at the commit log. Use this one below and not the one above since it's the new updated version that allows you to commit changes to svn repository from gedit. I don't know why I had to say that. But there you go. Notice the dot on the end. Although, you may want to change it to commit a single file instead of the cwd. If so then you can use $GEDIT_CURRENT_DOCUMENT_PATH instead. Just as a note for all my readers. I use my blog posts as a reminder for me for how I did certain things so that I don't have to re-google and re-research my finding again.
#!/bin/sh
svn ci -m "`zenity --entry --title="Commit" --text="Enter Commit Message"`" .
you might also want this as well:
#!/bin/sh
svn add $GEDIT_CURRENT_DOCUMENT_PATH
It's also not very hard to run python from external tools as well. See example below:
#!/bin/sh
python -c "
import os
os.system('ifconfig')
"
After having learned this about gedit. I have a feeling that I'm going to dwell on it alot more and come up with some plugins hopefully. That depends on how swamped I am with everything else though. Look for plugins in the near future. Hopefully one that can cook and clean. hehehe, jk. :)
Monday, November 3, 2008
.vimrc for python and php editing
Here is my .vimrc that I use for editing python scripts. I mostly use nano, but slowly I'm switching to vim. Anyway, here tis.
It's still a work in progress. Seeing as I'm just getting in the swing of things vim. If you want a vim cheat sheet you can find it HERE
If you want to have a vimrc file for PHP Editing Click HERE
Enjoy!
syntax enable
filetype indent on
set background=dark
set number
set tabstop=4
set textwidth=0
set nowrap
set et
set sw=4
set smarttab
set scrolljump=5
set showmode
set showmatch
map:w\|!python % #press F2 to run script
map:w :!svn commit #press CTRL-C to commit changes
It's still a work in progress. Seeing as I'm just getting in the swing of things vim. If you want a vim cheat sheet you can find it HERE
If you want to have a vimrc file for PHP Editing Click HERE
Enjoy!
Subscribe to:
Posts (Atom)