I’ve just created a new GitHub repo with GEdit snippets for Ruby on Rails. Any suggestions and comments are welcome.
To install them simply copy the xml files to your ~/.gnome2/gedit/snippets directory.
Refs:
GEdit
GEdit Snippets Plugin
# blah, blah!
I’ve just created a new GitHub repo with GEdit snippets for Ruby on Rails. Any suggestions and comments are welcome.
To install them simply copy the xml files to your ~/.gnome2/gedit/snippets directory.
Refs:
GEdit
GEdit Snippets Plugin
In my opinion, one of the worse inventions since “PC”, is the annoying (and I’m been respectful) Touchpad. Not only it takes you out of your home row (keyboard), or the fact that you need like two passes for reaching corners. But because it really &*^#$%^*$ annoys me when typing accidentally make a click.
Lucky me… there’s a way to disable Touchpad-Click. Simply go to System > Preferences > Mouse, click on Touchpad tab, and uncheck: Ennable mouse clicks with touchpad.
So long Touchpad-click!!!
Here’s how to add a recently created Ruby on Rails project to git:
1. Create your new project:
$ rails -d mysql project_name
2. Create some .gitignore empty files so you save the entire structure of your project (git doesn’t include empty folders):
$ touch db/.gitignore lib/.gitignore log/.gitignore tmp/.gitignore vendor/.gitignore
3. Create a new .gitignore file in the root directory of your project with the following content:
log/**/*
tmp/**/*
db/schema.rb
Note: If you are using sqlite add db/*.sqlite3 to .gitignore so you do not have the database into the repository (you can db:migrate it whenever you need it). Thanks for your reply Piku.
4. Initialize local repository:
$ git init
5. Add the project files and make que initial import:
$ git add .
$ git commit -a -m "* Initial import"
6. Finally if you have a gitosis server you can add it with the following commands:
$ git remote add origin git@YOUR_SERVER_NAME:project_name.git
$ git push origin master:refs/heads/master
That’s it, your project sources are now managed by git.
Happy hacking!
Based on a true story, the story of my own childhood… lol
Last week I made a great discovery on the net (at least great for me), a music video blog named La Blogotheque (http://www.blogotheque.net/ – french) – a.k.a. Take-Away Shows the English version (http://www.blogotheque.net/takeawayshows/).
What makes this site so great?
These guys have a concept of meeting new bands (or not so new) and take it to the street, recording the video in one single shot. What is even better is that the results are amazing, the songs are actually better than the originals most of the time. The bad, there’s no way to buy all that unedited, fresh, and great material. You can download the video during the next week after publish date.
Give it a try, you will not regret.
best!
Pretty easy do, simply run the following command from command line and you’re on the go:
$ sudo apt-get install texinfo texi2html tetex-bin
Now, use your favorite editor (gedit, vi, vim, emacs or texmacs) to start writing.
After a few weeks of researching we finally decided for Texinfo as our technical writing platform of choice. But before we did the switch, there was a serious complain about Texinfo: The inability to write plain spanish!!!
For us results really odd to write @’a for an a with accent, we still prefer á. So we found a workaround from Vladimir Támara (http://www.geocities.com/sl_edu_colombia/soluciones/vladimir/linux_esp.html), that used sed to replace all accents in our original texi file.
So here’s the howto:
Step 1
Create a file called encodetexi.sh (or name it whatever makes sense for you), and put the following bash code in it:
#!/bin/bash
sed -f encondetexi.sed $1 > tex/$1
This script will encode your accents to the formal Texinfo way with sed, and put them in the subdirectory tex/ (don’t forget to create it or change the script to handle the new subdir creation).
Once created give execute permitions to the script:
chmod 775 encodetexi.sh
Step 2
Create a file named encodetexi.sed which contains the substitution patterns for sed. Here is the content of the file:
s/á/@'a/g
s/Á/@'A/g
s/é/@'e/g
s/É/@'E/g
s/í/@'{@dotless{i}}/g
s/Í/@'I/g
s/ó/@'o/g
s/Ó/@'O/g
s/ú/@'u/g
s/Ú/@'U/g
s/ñ/@~n/g
s/Ñ/@~N/g
s/ü/@\"u/g
s/Ü/@\"U/g
This will replace all accents, tildes, etc. from our original texi file and create a well encoded file in tex/ subdir.
Step 3
Now plunge your texi files in plain spanish, use accents and tildes at will.
Step 4
Run the script (again, make sure you got tex/ subdir):
$ encodetexi.sh your_file.texi
Final thought
Funny… after revisiting this post it would make much more sense to be written in spanish :|
I changed my user password in Ubuntu, everything was OK until the next time I booted my Linux box. Keyring Manager was asking me for a password (as my wireless connection needed stored WPA password), immediately figured out that this was caused by the password change.
The problem is that Gnome Keyring manager doesn’t have an option to change the default keyring password. So, if your user password is changed, every time you log in Keyring Manager will ask for the password you supplied during Ubuntu’s installation (awkward).
Due the lack of password change in Keyring Manager we need another application: Seahorse. To install type the following:
$ sudo apt-get install seahorse
Once installed open it (Applications -> Accessories -> Passwords and Encryption Keys), and then go to Edit -> Preferences menu. Select GNOME Keyring tab and change the password to match your actual Linux user password.
Hello again, this time we’re going to setup a DynDNS client so your computer/server can be reached from anywhere.
Step 1
First, you need to create an account with DynDNS to do so follow this howto: https://www.dyndns.com/services/dns/dyndns/howto.html.
Step 2
First we’ll install ssh and ssh-socket so we can send our DynDNS user and password encrypted instead clear text:
$ sudo apt-get install ssh libio-socket-ssl-perl
Step 3
Install ddclient:
$ sudo apt-get install ddclient
Step 4
The installation will prompt you some questions. For the first one it ask for your dynamic DNS provider, select www.dyndns.com:

Then, put your fully qualified domain name(s):

Now, your DynDNS requistered username and password:


And finally, type “web” as the DynDNS interface to use:

Ok, so long we’ve finished installing ddclient but there’s still more work to do in order to get it working properly.
Step 5
We, need to change the ddclient configuration file (/etc/ddclient.conf) in order to use ssh to send the username and password, and to properly check the IP adrress. From the command line open ddclient configuration:
$ sudo vim /etc/ddclient.conf
In the generated configuration file you’ll probably see something like the following (The parts in italics will be different, the bold parts are going to change so special attention on this):
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=dyndns2
use=if, if=web
server=members.dyndns.org
login=your-dyndns-username
password='your-dyndns-password'
your-host-name.homelinux.net
Step 6
We need to change the configuration so ddclient get our public IP address properly, and to send our username and password over ssh.
DynDNS has a web interface to get your public IP address, this is equivalent to manually invoking http://checkip.dyndns.com/. But we need to properly configure this interface, so change the line use=if, if=web for the following:
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
Second, add to your configuration file just below the initial comments the following:
ssl=yes
daemon=300
The above two lines tells ddclient to use ssl for its connection and to update your public IP address every 5 minutes (specified in secconds).
Step 7
Now, we must make sure that ddclient is set to run as a deamon. Edit /etc/default/ddclient:
$ sudo vim /etc/default/ddclient
And make sure that:
# Configuration for ddclient scripts
# generated from debconf on Tue Jan 29 20:23:32 CST 2008
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time a
# new ppp connection is established. This might be useful,
# if you are using dial-on-demand
run_ipup="false"
# Set to "true" if ddclient should run in daemon mode
run_daemon="true"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="300"
Step 8
Finally, restart your ddclient and if no error is printed you’re good to go:
sudo /etc/init.d/ddclient restart
Port Forwarding
In order to deliver services on the net, you must open the corresponding ports for the services that your computer/server will provide, this is called Port Forwarding. Unfortunately this howto does not cover that topic. To do so you can visit http://www.portforward.com/routers.htm, where you can read how to port forwarding for your specific model of modem/router.
Happy hacking!
This mini HOWTO explains the required configuration for a static IP.
Before proceed we must know the following configuration of our network:
First, we must open for edit the file /etc/network/interfaces:
$ sudo vim /etc/network/interfaces
Once there, we must find the network interface to be configured from a dynamic IP address to a static one. In this case it will be eth0:
auto eth0
iface eth0 inet dhcp
In the above example we can see that the interface eth0 is configured for dhcp (dynamic address). To change to static IP address configuration we must set the following:
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
nerwork 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
Finally, we restart networking services:
$ sudo /etc/init.d/networking restart
And that’s it, we’ve now our server configured for static IP address.
Happy Hacking!