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
| server { | |
| listen 80; | |
| server_name something; | |
| root /opt/trends; | |
| #use google as dns | |
| resolver 8.8.8.8; | |
| location / { | |
| index index.html; |
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
| # Official docker image. | |
| image: docker:latest | |
| services: | |
| - docker:dind | |
| .ssh_template: &ssh_definition # Hidden key that defines an anchor named 'job_definition' | |
| before_script: | |
| - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | |
| - apk add --update rsync openssh-client |
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
| from django.contrib import admin | |
| from django.contrib.humanize.templatetags.humanize import naturaltime | |
| class HumanCreatedTimeModelAdmin(admin.ModelAdmin): | |
| def get_list_display(self, request): | |
| list_display = super(HumanCreatedTimeModelAdmin, self).get_list_display(request) | |
| try: | |
| list_display.index('created_time') | |
| except: |
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
| docker rm $(docker ps -qa --no-trunc --filter "status=exited") | |
| docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
| docker rmi $(docker images | grep "none" | awk '/ / { print $3 }') |
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
| docker rm $(docker ps -qa --no-trunc --filter "status=exited") | |
| docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
| docker rmi $(docker images | grep "none" | awk '/ / { print $3 }') |
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
| #!/usr/bin/env bash | |
| # This script prints out all of your Redis keys and their size in a human readable format | |
| # Copyright 2013 Brent O'Connor | |
| # License: http://www.apache.org/licenses/LICENSE-2.0 | |
| human_size() { | |
| awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
| } |
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
| #!/usr/bin/perl | |
| # | |
| # Nathanial Hendler | |
| # http://retards.org/ | |
| # | |
| # 2001-06-26 v1.0 | |
| # | |
| # This perl script parses a MySQL slow_queries log file | |
| # ignoring all queries less than $min_time and prints | |
| # out how many times a query was greater than $min_time |
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
| #!/usr/bin/env bash | |
| # This script prints out all of your Redis keys and their size in a human readable format | |
| # Copyright 2013 Brent O'Connor | |
| # License: http://www.apache.org/licenses/LICENSE-2.0 | |
| human_size() { | |
| awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
| } |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | |
| xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" | |
| xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> | |
| <url> | |
| <loc>http://www.example.com/foo.html</loc> | |
| <lastmod>2015-11-27T23:55:42+01:00</lastmod> | |
| <changefreq>daily</changefreq> | |
| <priority>0.5</priority> | |
| <image:image> |
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
| #SQL to backup user data | |
| "SELECT u.id, u.user_login AS username, u.user_pass AS | |
| PASSWORD , u.display_name AS first_name, '' AS last_name, u.user_registered AS date_joined, "1" AS is_active, u.user_registered AS last_login, u.user_email AS email, "0" AS is_staff, "0" AS is_superuser, "1" AS email_verified, ( | |
| SELECT p.guid | |
| FROM wp_posts p | |
| WHERE p.post_author = u.id | |
| AND p.post_type = 'attachment' | |
| LIMIT 1 |
NewerOlder