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
git checkout mybranch | |
git pull | |
git tag -m 'final commit for mybranch' archive/mybranch mybranch | |
git branch -D mybranch | |
git push --tags origin :mybranch |
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 | |
/** | |
* Remove any non-ASCII characters and convert known non-ASCII characters | |
* to their ASCII equivalents, if possible. | |
* | |
* @param string $string | |
* @return string $string | |
* @author Jay Williams <myd3.com> | |
* @license MIT License | |
* @link http://gist.github.com/119517 |
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
for database in /var/lib/mysql; do mysqldump -uroot -p $database | bzip2 - > /mnt/s3fs/$database.`date +%F`.sql.bz2; done |
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 | |
DB_STARTS_WITH="sb6-" | |
DBS="$(mysql -Bse 'show databases')" | |
for db in $DBS; do | |
if [[ "$db" == $DB_STARTS_WITH* ]]; then | |
echo "Deleting $db" | |
mysql -Bse "drop database \`$db\`" |
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
<style><!-- | |
/***** | |
* Site version alert block - admin theme | |
****/ | |
.header-siteversion div, | |
.header-siteversion p, | |
.header-siteversion .block { | |
line-height: 1.5em; | |
text-transform: uppercase; | |
margin: 0; |
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
'bank_aba_code' => '011002628', | |
'bank_acct_num' => '123456789123', | |
'bank_acct_type' => 'CHECKING', | |
'bank_name' => 'Bank of Earth', | |
'bank_acct_name' => 'Jane Doe', |
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
# Split MYSQL dump file | |
gunzip -c database.sql.gz | awk '/DROP TABLE IF EXISTS/{n++}{filename = "out" n ".sql"; print > filename; close(filename)}' | |
# Parallel import using GNU Parallel http://www.gnu.org/software/parallel/ | |
ls -rS *.sql | parallel --joblog joblog.txt mysql -uXXX -pYYY db_name "<" |
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
modinfo rt2800usb | grep 5370 | |
modprobe rt2800usb |
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
$entity_type = ''; | |
$field_name = 'field_'; | |
$bundle_name = ''; | |
$info_config = field_info_field($field_name); | |
$info_instance = field_info_instance($entity_type, $field_name, $bundle_name); | |
unset($info_config['id']); | |
unset($info_instance['id'], $info_instance['field_id']); | |
include_once DRUPAL_ROOT . '/includes/utility.inc'; | |
$output = "field config: " . drupal_var_export($info_config) . ";\n"; |
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 | |
from="1 March, 2021" | |
to="10 June, 2021" | |
users=$(git shortlog -sn --no-merges --since="$from" --before="$to" | awk '{printf "%s %s\n", $2, $3}') | |
IFS=$'\n' | |
echo -e "User name;Files changed;Lines added;Lines deleted;Total lines (delta);Add./Del. ratio (1:n);Commit count" | |
for userName in $users | |
do | |
result=$(git log --author="$userName" --no-merges --shortstat --since="$from" --before="$to" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6; delta+=$4-$6; ratio=deleted/inserted} END {printf "%s;%s;%s;%s;%s", files, inserted, deleted, delta, ratio }' -) | |
countCommits=$(git shortlog -sn --no-merges --since="$from" --before="$to" --author="$userName" | awk '{print $1}') |
OlderNewer