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
update wp_usermeta set meta_value='a:1:{s:13:"administrator";b:1;}' where user_id=16 AND meta_key="wp_capabilities" | |
update wp_usermeta set meta_value=10 where user_id=16 AND meta_key="wp_user_level" |
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
update wp_usermeta set meta_value='a:1:{s:13:"administrator";b:1;}' where user_id=ユーザID AND meta_key="wp_capabilities"; | |
update wp_usermeta set meta_value=10 where user_id=ユーザID AND meta_key="wp_user_level"; |
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
<html> | |
<head><title>MySQL Connection</title></head> | |
<body> | |
<?php | |
$link = mysql_connect('server','user_name','user_pass'); | |
if (!$link) { | |
die('failed'.mysql_error()); |
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
files="*" | |
for filepath in ${files} | |
do | |
if [ -e ${filepath}/${filepath}.jpg ]; then | |
mv ${filepath}/${filepath}.jpg ${filepath}.jpg | |
rm -rf ${filepath} | |
echo "UPDATE wp_posts SET post_content=REPLACE(post_content,'${filepath}/${filepath}.jpg','${filepath}.jpg');" >> sql_replace.sql | |
echo ${filepath}.jpg removed >> log.txt |
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
# http://pecoegg.com/website-131.html を参考にしました。 | |
# Macは初めから入っていないのでインストールしましょう | |
# | |
# 1)ダウンロード | |
sudo curl -O http://ftp.gnu.org/pub/gnu/wget/wget-1.15.tar.gz | |
# 2)解凍 | |
sudo tar zxvf wget-1.15.tar.gz | |
# 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
# ディレクトリ以下のファイル内の文字列を置換する | |
find . -type f -exec sed -i 's/ord string/new string/g' {} \; |
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
# Description: | |
# DOCOMOの雑談APIを利用した雑談 | |
# | |
# Author: | |
# FromAtom | |
getTimeDiffAsMinutes = (old_msec) -> | |
now = new Date() | |
old = new Date(old_msec) | |
diff_msec = now.getTime() - old.getTime() |
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
# ------------------- # | |
# 空のカラムをつくる | |
# ------------------- # | |
ALTER TABLE | |
`wp_posts` | |
ADD | |
`magazine-k-author` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; | |
# ------------------- # | |
# 置換する | |
# (SUBSTRING_INDEX は MySQL 独自の関数) |
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
UPDATE `wp_posts` SET `post_name`=REPLACE (`post_name`,"_","-") WHERE `post_type` = 'post'; |
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
// 1. 以下のスクリプトを実行 | |
function myFunction(){ | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
for(var i = 1;i <= 30;i++){ | |
for(var j = 1;j <= 35;j++){ | |
sheet.getRange(i+99,j).setValue(sheet.getRange(j,i).getValue()); | |
} | |
} | |
} | |
// 2. 100 列目以降に、左右反転してる表ができます |