.: Package Installation on NetBSD :.
If you're new to NetBSD and is a regular Linux user you might feel a little confused when it comes to install additional packages after the system installation. I hope this very quick guide can help you.
Well, all you have to do is to point your PKG_PATH environment variable to the right server and you're set!
export PKG_PATH=http://mirror.lncc.br/netbsd/NetBSD-5.1/packages/`uname -m`/All/
Now you just have to type the installation command and wait for the package to be downloaded and installed. Some useful tips:
pkg_add -v package : installs a package
pkg_delete package : removes a package
pkg_info | grep package_name : shows information about a installed packaged
I hope you enjoyed it! Take care! ;-)
Translate
Wednesday, June 12, 2013
Tips and Tricks for NetBSD - Network Configuration
.: Network Configuration :.
This is a quick guide for those new to NetBSD who want to setup network. In a general way, all you have to do is to edit 3 files:
# /etc/hostname.bge0 : noticed that the extension of this file is the name of the network card? ;-)
192.168.7.70 255.255.255.0 NONE
# /etc/myname : contains the hostname
flagmachine
# /etc/mygate : this file contains the network gateway
192.168.7.254
This is a quick guide for those new to NetBSD who want to setup network. In a general way, all you have to do is to edit 3 files:
192.168.7.70 255.255.255.0 NONE
flagmachine
192.168.7.254
Now just run the system script /etc/rc.d/network to restart the configurations!
That's it! :)
Tips and Tricks for Debian - Banner on the console
.: Banner on your console :.
When Linux finishes the boot process it reads the file /etc/issue (and /etc/issue.net for remote logins) from where it can find the text to be printed on the login screen.
Although you can edit those files, it is way cooler to display a banner! =)
Let's get our hands dirty!
When Linux finishes the boot process it reads the file /etc/issue (and /etc/issue.net for remote logins) from where it can find the text to be printed on the login screen.
Although you can edit those files, it is way cooler to display a banner! =)
Let's get our hands dirty!
- apt-get install linuxlogo
- cp /etc/inittab /etc/inittab.bkp
- sed -i s'/\/sbin\/getty 38400/\/sbin\/getty -f \/etc\/issue.linuxlogo\ 38400/'g /etc/inittab
- init q && killall -9 getty # This will drop you off of the terminal.
I hope you can spread this with your friends! :)
Tips and Tricks for Debian - Colored Theme for Bash
.: Colored Theme for Bash :.
Bash's first prompt level is managed by the environment variable PS1. If you like to tweak things (as I do), this post is a must! See how you can set PS1 to behave in different ways! =)
Just for you to get the whole idea, just try the following commands inside BASH:
Bash's first prompt level is managed by the environment variable PS1. If you like to tweak things (as I do), this post is a must! See how you can set PS1 to behave in different ways! =)
Just for you to get the whole idea, just try the following commands inside BASH:
- export PS1="{\d,\t - \W] \\$ "
- export PS1="{\d,\t}\n[\u@\h \W] \\$ "
- export PS1="C:\> " # This one is very funny. ;-P
Got the idea? Did you see how it works? Well, now let's create a configurable theme file for BASH. =)
The file will be called "bash_colors.defs".
#!/bin/bash
#
# Color Theme for BASH - PS1 configuration file.
# Gabriel Marques - snortt@gmail.com
# 09/09/2002
# 09/09/2002
#
# Color values
# There are 2 8 colors categories:
# Foreground - from 30 to 37
# Background - from 40 to 47
# If you want bold text, just add the char 1 right after the desired color.
#
# Foreground: 30-black; 31-red; 32-green; 33-yellow; 34-blue; 35-magenta; 36-cyan; 37-white
# Background: 40-black; 41-red; 42-green; 43-yellow; 44-blue; 45-magenta; 46-cyan; 47-white
#
# Color definitions
# Foreground
FGBLACK='\[\e[30m\]'
FGRED='\[\e[31m\]'
FGGREEN='\[\e[32m\]'
FGYELLOW='\[\e[33m\]'
FGBLUE='\[\e[34m\]'
FGMAGENTA='\[\e[35m\]'
FGCYAN='\[\e[36m\]'
FGWHITE='\[\e[37m\]'
#
# Background
BGBLACK='\[\e[40m\]'
BGRED='\[\e[41m\]'
BGGREEN='\[\e[42m\]'
BGYELLOW='\[\e[43m\]'
BGBLUE='\[\e[44m\]'
BGMAGENTA='\[\e[45m\]'
BGCYAN='\[\e[46m\]'
BGWHITE='\[\e[47m\]'
# Bold text definitions
# Foreground
FGBLACKB='\[\e[30;1m\]'
FGREDB='\[\e[31;1m\]'
FGGREENB='\[\e[32;1m\]'
FGYELLOWB='\[\e[33;1m\]'
FGBLUEB='\[\e[34;1m\]'
FGMAGENTAB='\[\e[35;1m\]'
FGCYANB='\[\e[36;1m\]'
FGWHITEB='\[\e[37;1m\]'
# Background
BGBLACKB='\[\e[40;1m\]'
BGREDB='\[\e[41;1m\]'
BGGREENB='\[\e[42;1m\]'
BGYELLOWB='\[\e[43;1m\]'
BGBLUEB='\[\e[44;1m\]'
BGMAGENTAB='\[\e[45;1m\]'
BGCYANB='\[\e[46;1m\]'
BGWHITEB='\[\e[47;1m\]'
# The RESET Color is important when you reach the end of a line.
# This stops the last color from spreading across the screen.
RESET='\[\e[0m\]'
# Now you just have to source this file and set your PS1 variable! :-)
# See the example, coded inside $HOME/.bash_profile:
# . /etc/bash_colors.defs
# PS1="${FGYELLOWB}[${FGGREENB}\u${FGYELLOWB}@${FGBLUEB}\h ${FGWHITEB}\W${FGYELLOWB}]${FGREDB}\\$ $RESET"
# This one is for root, if you want a compact and simple prompt, coded inside /root/.bash_profile.
# . /etc/bash_colors.defs
# PS1="${FGREDB}<_ROOT_> ${FGWHITEB}\W ${FGYELLOWB}\\$ $RESET"
I hope you liked it! Have fun! =)
Tips and Tricks for Debian - Colored Manpages
.: Colored Manpages :.
If you want your manpages to appear colored you won't miss this post!
Oh, by the way, they look a lot more comfortable to read! =)
Let's get straight to the point!
If you want your manpages to appear colored you won't miss this post!
Oh, by the way, they look a lot more comfortable to read! =)
Let's get straight to the point!
- apt-get install most
- echo MANPAGER="\"$(which most) -s\"" >> /etc/environment
And, for the current session:
- export MANPAGER="$(which most) -s"
How to create self installable packages using Makeself
How to create self installable packages using Makeself
You probably have downloaded a program and noticed that the file extension was ".sh". If you ever wondered how to create your own installable package, you'll love to play with the Makeself tool.
This is a very short introduction on how to make your own installable packages.
You can download it from the web here, or install it by using your package manager. For Debian, just type apt-get install makeself and hit ENTER.
The program syntax is very easy, as you can see bellow:
makeself [args] app_directory installer_file descriptive_text startup_script [script_args]
- args: Makeself options. Here are some of them:
- --gzip: uses gzip for compression
- --bzip2: uzes bzip2 for compression (cool, but takes more time to compress)
- --nocomp: uses no compression
- --append: updates an existing package with new files
- app_directory: Directory with all the files to be included in the package
- installer_file: This will be the file name for the created package
- descriptive_text: This is a simple string that tells users a little more about your package ;-)
- startup_script: This is the script the installer invokes to install your program
- script_args: These can be passed to the startup_script
Now that you have a good knowledge on the subject, let's create a simple installer. For this example we're going to create a wallpaper file installer.
The required steps are:
- Create the root directory for the program. The one to be passed for the installer.
- Create the wallpaper file(s) directory.
- Place the desired wallpaper(s) inside the directory.
- Pack the wallpaper dir inside the root directory (this will generate the "payload" file)
- Create the startup script
- Pack! :)
Ok, let's do it!
- mkdir my_wallpaper_installer
- mkdir my_wallpaper_installer/wallpapers
- cp Downloads/*.jpg my_wallpaper_installer/wallpapers
- cd my_wallpaper_installer/ && tar cjf data.tar.bz2 wallpapers
- echo '#!/bin/bash' > my_wallpaper_installer/setup.sh && echo 'tar xjf data.tar.bz2 -C /usr/share/' >> my_wallpaper_installer/setup.sh
- makeself --nocomp my_wallpaper_installer WallPaperInstaller.sh "This is my awesome wallpaper installer" ./setup.sh
Have fun! =)
Documents
.: Documents :.
Note: links are currently broken. I'm switching to another file repository.
Wednesday, Apr 13 2016
Here you'll find some material I've been producing over the time.
They're all in Portuguese, but I hope somehow they can help anyone.
If you believe you can help translating them to other languages, please feel free to contact me at ``snortt at gmail dot com''.
They're all in Portuguese, but I hope somehow they can help anyone.
If you believe you can help translating them to other languages, please feel free to contact me at ``snortt at gmail dot com''.
- LaTeX presentation
- Embedded Linux presentation
- Some annotations regarding OO programming
- Xen 4.0 installation on Debian Squeeze
- OpenBSD remote installation on SGI Tezro machines
Note: links are currently broken. I'm switching to another file repository.
Wednesday, Apr 13 2016
Subscribe to:
Comments (Atom)