sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #=============================================================================== | |
| # This is a template for a script I use on a lot of sites to copy the database | |
| # (MySQL) and any uploaded files to the development site, and modify the | |
| # database as required. | |
| # | |
| # The script should be on the development server. The live site can either be on | |
| # the same server, or a remote server connected via SSH. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This is a script I used to download my live site database onto my development | |
| # server when I used a web host that used cPanel, but didn't give me access to | |
| # mysqldump over SSH (because they had Jailshell enabled). | |
| # Note: The database name (DBNAME) excludes the account name prefix - i.e. | |
| # "dbname" not "sitename_dbname". | |
| curl http://USERNAME:PASSWORD@HOSTNAME:2082/getsqlbackup/DBNAME.sql.gz \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Easy Download Media Counter | |
| Plugin URL: http://remicorson.com | |
| Description: This plugin allows you to easily count downloads for a wordpress media and display it | |
| Version: 1.0 | |
| Author: Rémi Corson | |
| Author URI: http://remicorson.com | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Usage: | |
| #Name it something like mysql-db-create.sh | |
| #Make it executable $ sudo chmod 755 mysql-db-create.sh | |
| #Run it sudo ./mysql-db-create.sh dbname dbuser password | |
| # Functions | |
| ok() { echo -e '\e[32m'$1'\e[m'; } # Green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #start | |
| #----------------------------------------------------------------------- | |
| find /srv/backup/daily/databases/ -name '*.gz' -mtime +7 | xargs rm -f; | |
| find /srv/backup/daily/websites/ -name '*.gz' -mtime +7 | xargs rm -f; | |
| # Are Weekly Backups Implemented? | |
| # find /srv/backup/weekly/ -name '*.gz' -mtime +30 | xargs rm -f; | |
| #----------------------------------------------------------------------- | |
| #end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /[if IE 8] | |
| | <html class="ie8 lt-ie9" lang="en"> | |
| /[if IE 9] | |
| | <html class="ie9" lang="en"> | |
| /! [if (gte IE 9)|!(IE)]<!--> <html lang="en"> <!--<![endif] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/