World, I am going to start blogging again so that I can become better at it.
Stay tuned.
-- Martin Velez
Thursday, June 16, 2016
Thursday, June 21, 2012
Gitolite and SSH
![]() |
| gitolite and ssh |
SSH Information
I have a private key, ~/.ssh/ida_rsa_gitolite, in lab. I have already added my public key to gitolite. I also have an ssh configuration file in ~/.ssh/config file in lab.
mvelez@lab:~/.ssh$ cat config
host gitolite
user git
hostname host.name.com
identityfile ~/.ssh/id_rsa_gitolite
I can use the 'gitolite' alias.
mvelez@lab:~$ ssh -T gitolite
hello mvelez, this is git@server running gitolite3 v3.03-29-g3c0f177 on git 1.7.9.5
R W gitolite-admin
R W testing
And I can use git@host.name.com directly.
mvelez@lab:~$ ssh -T git@host.name.com
hello mvelez, this is git@server running gitolite3 v3.03-29-g3c0f177 on git 1.7.9.5
R W gitolite-admin
R W testing
What I really care about is being able to do this.hello mvelez, this is git@server running gitolite3 v3.03-29-g3c0f177 on git 1.7.9.5
R W gitolite-admin
R W testing
mvelez@eden:~$ git clone git@host.name.com:gitolite-admin
Cloning into 'gitolite-admin'...
remote: Counting objects: 132, done.
remote: Compressing objects: 100% (118/118), done.
remote: Total 132 (delta 18), reused 0 (delta 0)
Receiving objects: 100% (132/132), 30.35 KiB, done.
Resolving deltas: 100% (18/18), done.
Questions:
1) Do I have to run 'ssh-add ~/.ssh/id_rsa_gitolite'?
Tuesday, November 29, 2011
RubyCLI: A Ruby Command Line Application Module
Download ruby_cli, a Ruby gem I wrote to help create Ruby command line interface programs.
Here is an example program which uses ruby_cli.
#!/usr/bin/ruby
require 'rubygems'
require 'ruby_cli'
class App
include RubyCLI
def command
puts "Hello World"
end
end
app = App.new(ARGV, __FILE__)
app.run
Running the program:
Running the program with the help option.
Wednesday, March 2, 2011
Connect to MySQL via SSH Tunnel
I have set up a MySQL server and want to connect to it from different machines. However, I do not want to open it up to the public. To secure my connection, I will not allow external connections to the MySQL server. I will simply set up a SSH tunnel and connect to it that way. My local MySQL commands are forwarded to the remote host.
Assumptions:
Setting up the SSH tunnel:
Assumptions:
- You can SSH into the remote host.
- If you are like me, you are not running a MySQL on your local host.
Setting up the SSH tunnel:
- ssh -f -L 3306:localhost:3306 user@host -N
- Enter password:
Connect to MySQL
- mysql -h 127.0.0.1 -u user -p
- Enter password:
You should be see the MySQL prompt.
mysql>
Tuesday, January 25, 2011
Samsung Gravity T USB Connection on Mac
To connect your Samsung Gravity T to your Macbook go to
Menu > Settings > Phone Settings > PC Connection > Mass StorageThe USB cable must be unplugged and the phone must be on the idle/home screen.
Tuesday, September 21, 2010
Circular Google: Useless Top Search Results
![]() |
| Circular Google: http://ubuntuforums.org/showthread.php?t=401339 |
I google a lot. Google is my public library. If I have a question, I google for the answer. I also happen to think that I am in the majority. (Note: In the rant that follows, I am not blaming Google. Google is great!)
Sometimes, not too rarely, the number one Google hit contains a forum question similar or identical to mine followed by an rude and unhelpful jerk responding, "Google it!" This annoys me so much. The reason why this annoys me so much is because the forum response will not only be seen by the person posing the question but also by others with the same question. Eventually, this forum thread might become the number one search result, an useless top search result.
Thus, please if you are going to bother responding to someone on a forum, don't respond "Google it!" I did!!! Check out the Circular Google image above to see a perfect example of a useless top search result.
Saturday, September 4, 2010
Installing Ubuntu 10.4 on HP Pavilion tx2000
![]() |
| Ubuntu 10.4 on HP Pavilion tx2000: Monitor 1 |
![]() |
| Ubuntu 10.4 on HP Pavilion tx2000: Monitor2 |
Though, I am beginning to like Windows again thanks to Windows 7, I installed Ubuntu because I do Linux programming.
Wireless, tablet screen, and multiple monitors worked without having to hack anything. Ubuntu supports them.
Things that don't work:
- HP Quick Launch Buttons around the screen border
- DVD, QuickPlay, Settings, and Rotation
- Mute button doesn't turn red when muted but the volume buttons do work.
I must also say that the start up and shutdown times are amazing! The picture above demonstrates my Ubuntu desktop. I, of course, applied a dark theme to the controls and the window borders. It looks and feels great. I hope that this helps somebody trying do the same thing or something similar.
Friday, September 3, 2010
Soundness and Completeness
![]() |
| Universe |
Here is a loose definition of soundness and completeness.
An argument is sound if everything that can be derived from it is true; no false positives.
An argument is complete if everything that is true can be derived from it; no false negatives.
Referring to Universe figure above,
- A is sound.
- B is sound and complete.
- C is complete.
- D is neither.
Friday, August 20, 2010
Installing the MySQL RubyGem on Ubuntu
I have successfully installed the MySQL driver for Ruby on Windows and Mac OS X but I had not installed it on Ubuntu until today.
I am assuming that you have already installed the MySQL server. I am using MySQL 5.1.
$ sudo apt-get install mysql-server
Install the MySQL database client library. I am not certain of this but I believe that the number '15' in 'libmysqlclient15-dev' indicates the version. This is apparently the most current one and the default version on Ubuntu 10.4 as of today.
$ sudo apt-get install libmysqlclient15-dev
Install RubyGems if you have not done so already. I am using Ruby 1.9.1.
$ sudo apt-get install rubygems1.9
If everything was successfuly, then you should be able to use the mysql RubyGem in your Ruby scripts.
I am assuming that you have already installed the MySQL server. I am using MySQL 5.1.
$ sudo apt-get install mysql-server
Install the MySQL database client library. I am not certain of this but I believe that the number '15' in 'libmysqlclient15-dev' indicates the version. This is apparently the most current one and the default version on Ubuntu 10.4 as of today.
$ sudo apt-get install libmysqlclient15-dev
Install RubyGems if you have not done so already. I am using Ruby 1.9.1.
$ sudo apt-get install rubygems1.9
If everything was successfuly, then you should be able to use the mysql RubyGem in your Ruby scripts.
Installing Windows 7 Professional on HP Pavilion tx2000
Yesterday, I did a clean install of Windows 7 (32-bit) on my HP Pavilion tx2000 computer. I was very surprised and glad that I did not need to install much in order to get the computer to work. I feared that I would need to install many more drivers, for instance, the tablet driver.
Additional drivers installed from the HP support website:
I hope this helps somebody somehow.
Additional drivers installed from the HP support website:
- Realtek High Definition Audio
- Enables the mute button to change color to red when volume is muted.
- Source: http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-75992-4&lc=en&dlc=en&cc=us&os=4062&product=3744020&sw_lang=
- HP Quick Launch Buttons
- Enables most of the quick launch buttons on the screen border
- rotate, settings, media (prev, play, next, stop)
- Auto-rotates screen when you convert the laptop to a tablet
- Source: http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-78740-1&lc=en&dlc=en&cc=us&product=3744020&sw_lang=&os=4062
- DVD Quick Play button on the border of the screen
- I am not going to fix this. I thought it was annoying anyways. I kept on pressing it accidentally.
- Startup time is now 57 seconds.
- From being powered off to displaying the google homepage.
- Shutdown time is now 10 seconds
- With Vista it would literally get too hot for your lap. Now it always stays cool. I would dare to say that it stays cooler than my 13" Macbook.
I hope this helps somebody somehow.
Thursday, August 12, 2010
Formatting Hex Strings in Ruby
This method converts a 1 or 2 character string representing a hex number into a 2 character string representing a hex number.
Usage examples:
Implementation:
Usage examples:
irb(main):001:0>format("a")
=> "0A"
irb(main):002:0>format("2D")
=> "2D"
Implementation:
def format_hex_string(byte)
byte.upcase
byte.to_i(16) >= 16 ? byte : "0" + byte
end
Cartesian Product in Lisp
One of the things I do quite often is calculate the Cartesian product of two lists. Here is my solution to problem in Lisp.
Usage Example:
Implementation:
Usage Example:
> (product '() '())
NIL
> (product '(1 2) '(1 2 3))
((1 1) (1 2) (1 3) (2 1) (2 2) (2 3))
Implementation:
(defun product (list1 list2) (let (templist '()) ;;iterate through the first list (dolist (item1 list1) ;;iterate through the second list (dolist (item2 list2) ;;create a list from the current items and push it onto the temporary list;; (push (list item1 item2) templist) ) )
;;reverse the temporary list to display it correctly (nreverse templist) ))
Subscribe to:
Posts (Atom)










