Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This list will get continues updates. So bookmark this page if you think it is usefull!
- list all installed packages with a short description:
- - dpkg-query -l
- Count all files in the folder named maps:
- - find maps -type f | wc -l
- Check free diskspace:
- - df -h
- Delete a folder and the content inside
- - rm -rf foldername
- //=================================== Cronjobs ================================================================//
- See cronjobs:
- - crontab -l
- Or for a user:
- - crontab -l -u username
- contains all the configured crontabs of all users - except the root user who is also able to configure jobs via the system-wide crontab, which is located at /etc/crontab
- With cronie (default on Fedora/CentOS), there is a .d style config directory for system cron jobs, as well:
- - /etc/cron.d
- (As always, the .d directory simplifies maintaining configuration entries that are part of different packages.)
- For convenience, most distributions also provide a directories where linked/stored scripts are periodically executed, e.g.:
- /etc/cron.daily
- /etc/cron.hourly
- /etc/cron.monthly
- /etc/cron.weekly
- //==================================== Nano notes ==============================================================//
- Go to line 100 in a certain file:
- # nano +100 /var/www/html/test/test.php
- Or when in nano you can use ctrl-_ (ctrl + shift and -) to enter a line number to go to.
- //===============================================================================================================//
- chown stands for: change file owner and group.
- Free command shows free, total and swap memory information in bytes.
- # free
- To recursively give directories read&execute privileges:
- # find /path/to/base/dir -type d -exec chmod 755 {} +
- To recursively give files read privileges:
- # find /path/to/base/dir -type f -exec chmod 644 {} +
- //==================================== How to know wich linux version =========================================//
- # cat /proc/version
- Output will be:
- - Linux version 2.6.13-15-default (geeko@buildhost) (gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)) #1 Tue Sep 13 14:56:
- UTC 2005
- More specific:
- # cat /etc/issue
- Output will be:
- - Welcome to SUSE LINUX 10.0 (i586) - Kernel \r (\l).
- //============================================================================================================//
- I tried "php -v"
- A command like this will only work if you have the CLI version of PHP installed. If you have only the Apache module version of PHP this will not work.
- You can install the CLI version with this command:
- apt-get install php5-cli
- //============================================================================================================//
- Command chaining:
- # sudo mkdir test; cd test; sudo mkdir yetAnotherTest; cd yetAnotherTest
- //=========================
- Grant user rights to edit /var/www
- sudo chown -R username /dfvar/www
- //======= Recover root password ===========//
- If you forgot your root password for your debian server use the following procedure to reset.
- Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.
- Using your keyboard arrow keys, move the cursor down a line or so, and press <e> (for edit) again, you should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the spacebar once, if necessary, to add a space, and then add one of the folllowing:
- init=/bin/bash
- or
- init=/bin/sh
- Then press <Enter>, and you're back at the kernel line, press <b> (for boot) and the computer will proceed to boot to a root prompt.
- At this point, the root file system is still mounted read-only, so enter the following command:
- mount -n -o remount,rw /
- Then type:
- passwd
- Enter your new password. Retype if asked to confirm.
- Then restart the machine by typing:
- reboot
- Now you should be able to login with your new root password as required.
- // =================
- How to set phpMyAdmin default 1440 second timeout higher:
- locate php.ini el@apollo:/var/lib/phpmyadmin$ locate php. ini /etc/php5/apache2/php. ini.
- open the file as root to edit, find this line: session. gc_maxlifetime = 1440.
- Change it to this (500000 seconds is 5.7 days) session. gc_maxlifetime = 500000.
- Restart apache.
Add Comment
Please, Sign In to add comment