diochnos/tips/customizing
Table of Contents
- General Information
- Linux: Terminal, X, lpr (double-sided), Basic Group Handling, Apache - PHP, Raspberry Pi Related (Version of Raspberry Pi, Raspberry Pi OS and Architecture Information, Find All Things Listening to Ports, NMAP, fail2ban, VPN, , Pi-hole, Dealing with IPv6 Time-Outs During Updates/Upgrades), LaTeX
- MAC OS
General Information
General information about what sort of customizations can be found in this webpage.
Regarding linux, the distribution that I have in mind is debian.
Linux
Information specific to linux will show up here.
Terminal Related
Below are my standard customizations for using the terminal.
.bash_aliases
This is the file that I am using.
.bashrc
I introduce the following two lines in the top of .bashrc:
- export PATH="$HOME/bin:/opt/bin:$PATH"
- export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
- LS_COLORS=$LS_COLORS:'di=0;96:' ; export LS_COLORS
- export HISTTIMEFORMAT="%y/%m/%d %T " # So that we can have a timestamp on history
.bash_profile
This is the file that I am using.
[Terminal Related] [Table of Contents] [Top]
X Windows
Below are some standard customizations using X Windows.
.xinitrc
This is the file that I am using (debian squeeze + WindowMaker).
.Xresources
This is the file that I am using (debian squeeze + WindowMaker).
[X Windows] [Table of Contents] [Top]
lpr
For double-sided (portrait) printing lpr needs the option: -o sides=two-sided-long-edge
[lpr] [Table of Contents] [Top]
Basic Group Handling
Here is a good source.
Apache - PHP
In order to make apache work and enable PHP the following should be done:
- install the packages php5, libapache2-mod-php5 (or the latest phpX package)
- create symbolic links under the directory /etc/apache2/mods-enabled/ to the files ../mods-available/userdir.conf and ../mods-available/userdir.load
- edit the file /etc/apache2/mods-enabled/php5.conf and comment out the 5 lines that are indicated inside the file so that php is enabled.
Port Forwarding
In order to make Apache responsive to the outside world we have to forward the following ports and protocols:
- 80, TCP
- 443, TCP/UDP
[Apache - PHP] [Table of Contents] [Top]
Raspberry Pi Related
Version of Raspberry Pi
cat /sys/firmware/devicetree/base/model; echo
Raspberry Pi OS and Architecture Information
cat /etc/os-release
uname -a
Find All Things Listening to Ports
lsof -l -n -P | grep LISTEN
NMAP
There are several useful commands - though DO NOT FORGET TO ASK FOR PERMISSION if you are scanning a LAN that is not yours! No matter how innocent the scan may be. Prepending with sudo gives more information. Some examples follow.
- sudo nmap -A -T4 localhost (or some appropriate IP here)
- sudo nmap -sn 192.168.86.0/24 (this time with a report on the entire local network)
fail2ban
Copy /etc/fail2ban/jail.conf to /etc/fail2ban/jail.local and edit that file. I tend to give bantime at least 1800 instead of the 600 default seconds. Maximum number of retries also changes to 3 from 6.
Pi-hole
Some modifications may be needed when running Apache by default. See here.
VPN Related
We can use pivpn. We can create additional profiles using `pivpn add`.
Network Troubleshooting
Here are some useful commands:
- Try to use the Network Manager and understand what is going on.
- Get a list of all connections: sudo nmcli c show
- Get information about specific connection (e.g., ethernet): sudo nmcli c show put-name-of-eth0-connection-here
- ifconfig
- ip a
- sudo journalctl -b | grep eth0
Dealing with IPv6 time-outs for apt-get update/upgrade
Updating/upgrading the system using apt-get, times out for some servers when using IPv6. Instead one can use commands like the following one and force the use of IPv4.
apt-get -o Acquire::ForceIPv4=true update/upgrade
[Raspberry Pi] [Table of Contents] [Top]
LaTeX
Information specific to texlive.
Path for Packages
Up until debian squeeze (6.0) the directory for the packages of texlive used to be /usr/share/texmf-texlive/tex/latex. However, after migrating to wheezy (7.0) it appears that this path has moved to /usr/share/texlive/texmf-dist/tex/latex.
[LaTeX] [Table of Contents] [Top]
Convert Images to Encapsulated Postscript Files
Oftentimes I want to introduce a screenshot to my slides (say, using beamer). The conversion can be done with the command:
convert image.png image.eps
However, a more useful version of the above command is probably the one that creates the minimum size for the eps file:
convert image.png eps3:image.eps
[LaTeX] [Table of Contents] [Top]
MAC OS
Information specific to MAC OS will show up here.
igraph
After upgrading to Mavericks (10.9.x) I installed MacPorts under a custom directory: /opt/macports/latest. For the configuration of the latest igraph version 0.7.0 (as of this writing; link) I used the following command:
./configure LIBS=-L/opt/macports/latest/lib CFLAGS=-I/opt/macports/latest/include --prefix=/opt/igraph/0.7.0-pre
[Table of Contents] [Top]