17 private links
You want to use the -newermt
option for find
:
find /media/WD/backup/osool/olddata/ -newermt 20120101 -not -newermt 20130101
to get all the files with modification time in 2012.
These scripts are automatically generated from YAML files which can be found under specs/.
The format supports nested subcommands, specifying enums for possible parameters/option values and dynamic completion calling an external command.
The generation is done with the appspec tool (see "Developing" below).
Currently it supports bash and zsh completions.
Security in WordPress is taken very seriously, but as with any other system there are potential security issues that may arise if some basic security precautions aren't taken. This article will introduce you to basic security concepts and serve as an introductory guide to making your WordPress website more secure.
This article is not the ultimate quick fix to your security concerns.
You can use this script to fix wordpress permission:
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
WS_GROUP=www-data # <-- webserver group
# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find ${WP_ROOT} -type d -exec chmod 755 {} \;
find ${WP_ROOT} -type f -exec chmod 644 {} \;
# allow wordpress to manage wp-config.php (but prevent world access)
chgrp ${WS_GROUP} ${WP_ROOT}/wp-config.php
chmod 660 ${WP_ROOT}/wp-config.php
# allow wordpress to manage wp-content
find ${WP_ROOT}/wp-content -exec chgrp ${WS_GROUP} {} \;
find ${WP_ROOT}/wp-content -type d -exec chmod 775 {} \;
find ${WP_ROOT}/wp-content -type f -exec chmod 664 {} \;
save it to a file and run it and pass it your wp installation directory:
wget https://gist.github.com/Adirael/3383404/raw/6c5446d56477426faeb709e5b807f00422acdea2/fix-wordpress-permissions.sh
chmod +x fix-wordpress-permissions.sh
sudo ./fix-wordpress-permissions.sh /var/www/html
What you want is:
cp -R t1/. t2/
The dot at the end tells it to copy the contents of the current directory, not the directory itself. This method also includes hidden files and folders.
Most languages have naming conventions for variables, the most common style I see in shell scripts is MY_VARIABLE=foo. Is this the convention or is it only for global variables? What about variables local to the script?
shove - Prove-like Test Tool for Shell Scripts
This tutorial is a beginners handbook for new Linux users / Sys admins and school students studying Linux or computer science. This book is licensed under "Creative Commons Attribution Noncommercial Share Alike 3.0 Unported".
Un aide mémoire
now=$(date)
OR
now=date
27
down vote
favorite
8
When writing more than a trivial script in bash, I often wonder how to make the code testable.
It is typically hard to write tests for bash code, due to the fact that it is low on functions that take a value and return a value, and high on functions that check and set some aspect in the environment, modify the file-system, invoke a program, etc. - functions that depend on the environment or have side effects. Thus the setup and test code become much more complicated than the code they test.
You can sort then uniq:
$ sort -u file.txt
Quelques infos et conseils intéressants