Tips for Securing a LAMP Server

David’s answer is a good baseline of the general principles of server hardening. As David indicated, this is a huge question. The specific techniques you take could depend highly on your environment and how your server will be used. Warning, this can take a lot of work in a test environment to build out and … Read more

How to install/change locale on Debian?

Edit /etc/default/locale and set the contents to: LANG=”nl_NL.UTF-8″ You can check which locales you currently have generated using: locale -a You can generate more by editing /etc/locale.gen and uncommenting the lines for the locales that you want to enable. Then you can generate them by running the command: locale-gen You can find a list of … Read more

Does getting disconnected from an SSH session kill your programs?

Edit for 2016: This Q&A predates the systemd v230 debacle. As of systemd v230, the new default is to kill all children of a terminating login session, regardless of what historically valid precautions were taken to prevent this. The behavior can be changed by setting KillUserProcesses=no in /etc/systemd/logind.conf, or circumvented using the systemd-specific mechanisms for … Read more

How to display certain lines from a text file in Linux?

sed -n ‘10000000,10000020p’ filename You might be able to speed that up a little like this: sed -n ‘10000000,10000020p; 10000021q’ filename In those commands, the option -n causes sed to “suppress automatic printing of pattern space”. The p command “print[s] the current pattern space” and the q command “Immediately quit[s] the sed script without processing … Read more

How do I list loaded Linux module parameter values?

You can do it by using this simple one way command, which uses the /proc/modules and /sys virtual filesystems: cat /proc/modules | cut -f 1 -d ” ” | while read module; do \ echo “Module: $module”; \ if [ -d “/sys/module/$module/parameters” ]; then \ ls /sys/module/$module/parameters/ | while read parameter; do \ echo -n … Read more

Is it possible to alias a hostname in Linux?

For those who don’t have an account on the forums (or don’t wish to login): if your main issue is not to ping but to ssh, you can create/edit your ~/.ssh/config adding lines like these: Host fakehost1 Hostname real-hostname Host fakehost2 Hostname real-hostname2 Host fakehost3 Hostname real-hostname3

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)