Posted by Justin on September 9, 2009 – 7:05 am
Well let me give you an interesting script i found on Tech Republic………..
Its how to Tweet from the command line using cURL, its very simple and to the point….just like a script should be
tweet.sh
#!/bin/sh
tweet="${@}"
user="username"
pass="sekret"
if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then
echo "FATAL: The tweet is longer than 140 characters!"
exit 1
fi
curl -k -u ${user}:${pass} -d status="${tweet}" https://twitter.com/statuses/update.xml >/dev/null 2>&1
if [ "$?" == "0" ]; then
echo "Successful tweet!"
fi
to us it just type this
$ ~/bin/tweet "social server rules"
the only other thing to worry about is you have to escape “?”, “!” -> “\?”, “\!”
Posted by Justin on September 9, 2009 – 1:44 am
Filed under PHP, software
I was trolling through the internet and found this little application, Server2go , So i decided to look into it.
the software contains a great list of features that any web devolper needs for presenting there app to clients, there are many other great uses for this product, to many to list.
- Complete WAMPP Server-Stack
- Runs directly from CD-ROM, USB Stick or Hard disk without installation
- Full featured webserver (based on apache)
- PHP 5.x support with many extensions installed (e.g. gd)
- Supports SQLite databases
- Runs on all versions of Windows from Win 98 and above, MAC OSX support is coming
- Support for MySQL 5 Databases
- Supports many PHP extensions (GD-Lib, PDO…) by default
- Support for Perl 5.8
It pretty much turns any PC into a devolopement enviroment or a portible application that can be run on almost any windows based PC.
So after loading it up onto my USB drive unpluging it and plugging it back in, it started the server2go.exe and started apache without an error, no configuration of the server except the simple ini file to tweak the behaviour of the servers that are avaible.
Next i started up phpmyadmin and loaded up an old test DB with the PHP app to go with it, so far so good, DB loaded up and worked great, was able to connect to mysql with the mysql client as well. After that I used the browser that opend up with the server2go app and there was my PHP web app sitting there waiting to be tested, This app is a simple login to test DB connections. It worked with out error and so far the PHP is working great with out any PEAR errors or missconfiguration………
This is definitly being added to my tools, it may even have the ability to be a portable webserver on any home network, or even an application server for those with home business that need a simple CRM like “simple customer”.
Posted by Justin on September 1, 2009 – 9:19 pm
Filed under Linux, OS
Tagged as Linux, OS
I was checking out Hackaday (one of my favorite sites)
and found this http://blog.lxde.org/?p=514
and looked it over, its pretty cool that they took a debian system and brought it down under 400MB, which is pretty amazing, but its still not small enough for me, so i will still be compiling my lfs system but i am going to try out this new distro, so look later for a quick review
update- I might have to wait till I get home, my proxy is telling me no route to host, may be due to Hackaday syndrom, I will try later
Posted by Justin on September 1, 2009 – 8:40 am
Filed under Linux, OS, software
Tagged as LFS, Linux, OS, script
In chapter 6.4 in the stable release of LFS you need to chroot into your build environment, and I have to keep rebuilding the chroot, and i keep going back to my PDF and retyping all the commands so i created on that would rebuild the environment by just calling my new script, then make it one better CP it into /usr/bin and make it executable
#!/bin/bash
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
chroot "$LFS" /tools/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h
just copy and past the above code into a new file and called it lfsroot then if you just want to make it into a command copy it into /usr/bin and you are ready to go, the script will mount the file systems and the enter the chroot environment
This has saved me plenty of time by not typing or copying and pasting commands, My next script will be a script that will tar and cd into the directory of source packages……look for it soon