Skip to content

Instantly share code, notes, and snippets.

1.再帰的に.svnを削除する方法
find . -type d -name .svn -print0 | xargs -0 rm -rf
2.grep to search the current directory for any and all files containing the string
grep -r --include=*.{cc,h} "hello" .
3.centos list openning port
netstat -tln
4. –excludeの指定の仕方だが、--exclude ‘xxxxx’ でも、--exclude =”xxxxx”でもどちらでもいける。
5. git diff でファイル名のみ表示する
git diff 比較ブランチ名 --name-only
6. mysql dump&restore
@syslab-li
syslab-li / about git.md
Last active September 11, 2018 03:45 — forked from naosim/renameGitBranch.md
ローカルとリモートのブランチ名を変更する

1 #ローカルとリモートのブランチ名を変更する

以下、ブランチ名を hoge から foo に変更する例

  • ローカルのブランチ名変更
git branch -m hoge foo
  • リモートのブランチを消す
@syslab-li
syslab-li / gist:8123dbfe9a979f2e38b72e6ff9aa49d8
Last active August 23, 2018 10:37
There were *** failed login attempts since the last successful login
以下のコマンドにより,攻撃元のIPアドレスをログから調べることができます。
grep -i Failed /var/log/secure
https://www.server-memo.net/server-setting/ssh/ssh-denyhosts.html
Nginx で Basic 認証
yum install httpd-tools
$ sudo htpasswd -c /etc/nginx/.htpasswd username
New password: password
Re-type new password: password
Adding password for user username
@syslab-li
syslab-li / gist:b9c1ac9c5019ccda1ee3978e46ead2fb
Created October 11, 2018 05:14
mysqldumpをgzipでバックアップとリストア

mysqldumpをgzipでバックアップとリストア

  • ディスク容量と転送時間をちょっとでも短縮させたい時にgz形式が便利。

dumpでバックアップ取るとき

mysqldump -u user -p password dbname | gzip > dbname.dump.gz 
@syslab-li
syslab-li / Envoy.blade.php
Created August 13, 2019 10:39 — forked from gvsrepins/Envoy.blade.php
A Laravel envoy script for deployment
@servers(['production' => 'productionserver', 'local'=> 'vagrant@127.0.0.1 -p 2222'])
{{-- Configuration section --}}
@setup
/*
|--------------------------------------------------------------------------
| Git Config
|--------------------------------------------------------------------------
|
@syslab-li
syslab-li / supervisord.service
Created October 16, 2019 10:13 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown