Posts

Showing posts with the label vim

Make things light.

Image
You have lite beer, lite this, lite that. Why not apply the same idea to your computing. Why do you need a big fancy over bloated piece of software just to edit a web page? Well in some cases it might be required, but in most cases probably not. Available for most platforms Vim a lightweight text editor will fir the job I want to do to a tee. Vim looks simple and possibly not very useful, but it is exactly the opposite. You even have extensive on-line help. Even though vim is text based you can do pasting from the gui into it, so it is not completely guiless. But to get back to what is important, we need a light program to do some editing. In this case we want to edit a web page on a remote system without ever leaving our desk. Because vim is light, it loads in quickly thereby saving time. The server we want to access could be in the next room or even half way around the world. Remote access puts it at our fingertips. Let's log into the remote server and fire up vim...

Va va vim.

Image

Arduino music.

Image
Notice: this article is for linux based users. see also: http://computoman.blogspot.com/2015/05/arduino-music-starter-update.html The Arduino is one of the neatest microcontrollers.  For something so simple, it can do an amazing amount of projects. One such project that interested me was the Digital melody project. If you have one the the Arduinos where the Atmel chip can be removed, you can make your own project without the board once the programming is done. For this project, all you will need is the Arduino, usb cable (for programming), computer, some wires, optional 100 ohm resistor, and an old eight ohm speaker. Usually the back of speakers on the magnet have what resistance they are. So grab the old dead radio or the like that has a speaker and see what it has. Old personal computers are likely to have one too that you can borrow for a minute. Now you need to build the circuit. It is minimal and you should be able to set it up quickly. Resistor adds safety for pr...

Goodbye line numbers.

Image
Ever copy code into vim and realize that the line numbers were also copied. Here is a quick easy way to get rid of the line numbers. Original code: We want to remove the first 5 characters from every line so then we need to use the normal option: :%normal 5x Press return and the line numbers are gone! Some other tricks: Remove first 2 characters of every line, only if they're spaces: :%s/^ / Note that the last slash is optional, and is only here so that you can see the two spaces. Without the slash, it's only 7 characters, including the :. Move indentation to left for every line: :%normal <<

Notes to myself.

Using a blog to keep miscellaneous notes is a wonderful idea.  They should be always there. #---------------------------- # original install ls -l /var/log/installer #----------------------------- # uptime uptime #----------------------------- # Quicknote (goes into .bash_history) cat > filename <<EOF #--------------------------------- # Quick append (goes into .bash_history) cat >> filename <<EOF #-------------------------------- #Gif to avi convert test.gif old%02d.jpg ffmpeg -r 25 -i old%02d.jpg -y -an new.avi #--------------------------------- # Strip music mplayer -ao pcm:fast:file=batmanpiano.mp3 -vo null -vc null Batmanpiano.flv #---------------------------------- # get screen size $ fullscreen=$(xwininfo -root | grep 'geometry' | awk '{print $2;}') $ echo $fullscreen 1280x768+0+0 #---------------------------------- # put picures in frame montage Inputfiles outputfile #---------------------------------- ...

Put a little vim in your life.

Image
If you ever take the time to see what vim can do you would be very surprised. At least on Arch linux, there has been an update to vim.

Guiless?

Image
You actually can do a minimal windowing from the command line in Linux with dvtm. Dvtm is excellent for low end machines where graphics are not a priority. In the picture shown we have a working clock, SC a spreadsheet that you can easily export data to your favorite desktop spreadsheet such as Libreoffice, Links2 a web browser pointed to www.google.com, and finally nano a pretty decent basic text editor. I prefer vim, but nano has more of a user interface. Cheatsheet: `dvtm` is one simple, easy-to-use terminal multiplexer. Commonly used Options:     -v         prints version information to standard output, then exits.         -m <mod>   set default modifier at runtime.         [cmd...]   Execute cmd after dvtm is started. KeyBoard Shortcuts:     Mod    Each keybinding begins with Mod which defaults to ^...