Skip to content

Instantly share code, notes, and snippets.

Excelでシート名一覧を取得するワンライナー
For Each i In ThisWorkbook.Sheets: debug.print i.name : next i
@tekk555
tekk555 / gist:d3e46acb668d972ebdc8993d584479ff
Last active February 7, 2023 02:04
Excelのリンク解除
Sub RemoveLink()
Dim wb As Workbook
Set wb = Application.ActiveWorkbook
If Not IsEmpty(wb.LinkSources(xlExcelLinks)) Then
For Each link In wb.LinkSources(xlExcelLinks)
wb.BreakLink link, xlLinkTypeExcelLinks
Next link
End If
End Sub
Memory Segmentation Cheat Sheet
Oracleのスキーマをコピーするスクリプト
(実際に動作するかは試していない)
create user [DEST_SCHEMA] identified by [DEST_SCHEMA] default tablespace USERS temporary tablespace TEMP profile DEFAULT;
grant create session,create table,create view,create sequence,create trigger,create synonym,unlimited tablespace to [DEST_SCHEMA];
expdp system/manager SCHEMAS=[SRC_SCHEMA] DIRECTORY=DATA_PUMP_DIR DUMPFILE=[SRC_SCHEMA].dmp
impdp system/manager DIRECTORY=DATA_PUMP_DIR DUMPFILE=[SRC_SCHEMA].dmp REMAP_SCHEMA=[SRC_SCHEMA]:[DEST_SCHEMA]
@tekk555
tekk555 / gist:347896307eaa8d03c7e56f55b88ab3f9
Last active March 25, 2022 01:43
左辺と右辺を交換する正規表現
左辺と右辺を交換する正規表現
検索文字列
([ \t]*)(.*[^ ])([ ]*=[ ]*)(.*[^ ])(;)
置換文字列
\1\4\3\2\5
説明
()でグループ化した文字列を、置換文字列で入れ替えする仕組み。
@tekk555
tekk555 / gist:7496445
Last active December 28, 2015 11:49
CentOSにDelegateをインストールする。RDPをHTTPS(443)Portでリレーする。
# yum install gcc gcc-c++ make openssl-devel
# yum wget
# wget ftp://ftp.delegate.org/pub/DeleGate/delegate9.9.7.tar.gz
# tar zxvf delegate9.9.7.tar.gz
# cd delegate9.9.7
# make
(途中で管理者宛のメールアドレスを聞かれるので入力してEnterを押す)
# cp src/delegated /usr/local/sbin/
# ln /usr/local/sbin/delegated /usr/sbin/delegated
# mkdir /etc/delegate
@tekk555
tekk555 / gist:7392721
Last active December 27, 2015 21:39
log4j.propertiesの指定方法
1.log4j.propertiesをClassPathの通っている場所に配置する
2.JVMオプションで指定する
-Dlog4j.configuration=file:///c/conf/log4j.properties
3.プログラムからPropertyConfigurator.configureを使用して設定する。
import org.apache.log4j.PropertyConfigurator;
PropertyConfigurator.configure(replacedPath);
@tekk555
tekk555 / gist:7183653
Last active December 26, 2015 16:59
Log4Jのlog4j.propertiesをJavaのオプションで指定する
Windows
-Dlog4j.configuration=file:///c/user/log4j.properties
Linux
-Dlog4j.configuration=/home/user/log4j.properties
@tekk555
tekk555 / gist:7177074
Created October 27, 2013 01:56
userをsudoできるようにする
usermod username -a -G sudo
@tekk555
tekk555 / gist:7176920
Created October 27, 2013 01:35
rsyncの使い方(リモート)
あらかじめrsyncサーバを構築しておく。rsyncクライアントはUbuntuにデフォルトでインストールされている
https://help.ubuntu.com/community/rsync
rsync -azvv --delete shell/ user@hostname::shell/
windowsからcwrsync経由でrsyncするときはコピー元をcygwin形式で記述
c:\build\フォルダの場合は、/cygdrive/c/build/