This file contains 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 | |
set -eux | |
apt -y update | |
#echo grub-pc hold | dpkg --set-selections | |
#apt -y upgrade | |
#sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config | |
#systemctl restart ssh |
This file contains 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 | |
# Precondition: `export PROMPT_COMMAND="history -a"` in .bashrc for ubuntu user | |
set -eux | |
COMMAND_TIME=$(date -Is -r /home/ubuntu/.bash_history) | |
NOW=$(date -Is) | |
if [[ $(date -d "$NOW" +%s) -lt $(date -d "$COMMAND_TIME +60 minutes" +%s) ]]; then |
This file contains 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
[Unit] | |
Description=Auto shutdown | |
[Service] | |
Type=oneshot | |
ExecStart=/opt/autoshutdown/autoshutdown.sh |
This file contains 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
// unclink.js | |
if (window.addEventListener && Array.prototype.indexOf | |
&& document.createDocumentFragment) { | |
window.addEventListener('DOMContentLoaded', function() { | |
function uncToUrl(unc) { | |
var ua = navigator.userAgent; | |
if (ua.indexOf('Macintosh') >= 0) { | |
return unc.replace(/^\\\\/, 'smb://').replace(/\\/g, '/'); | |
} else if (ua.indexOf('Firefox') >= 0) { |
This file contains 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 | |
// PukiWiki - Yet another WikiWikiWeb clone | |
// $Id: attach.inc.php,v 1.82 2006/04/14 23:51:12 teanan Exp $ | |
// Copyright (C) | |
// 2003-2006 PukiWiki Developers Team | |
// 2002-2003 PANDA <panda@arino.jp> http://home.arino.jp/ | |
// 2002 Y.MASUI <masui@hisec.co.jp> http://masui.net/pukiwiki/ | |
// 2001-2002 Originally written by yu-ji | |
// License: GPL v2 or (at your option) any later version | |
// |
This file contains 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
javascript:(function(){ | |
function checkUploadFile() { | |
var maxLength = 100; | |
function getHexNameString(s) { | |
var enc = encodeURIComponent(s); | |
var result = ''; | |
for (var i = 0; i < enc.length; i++) { | |
if (enc.substr(i, 1) === '%') { | |
result += enc.substr(i + 1, 2); | |
i += 2; |
This file contains 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
javascript:( | |
function(){ | |
var h1list = document.getElementsByTagName('h1'); | |
if (h1list.length == 0) { | |
return; | |
} | |
var h1 = h1list[0]; | |
if (h1.className != "title") { | |
return; | |
} |
This file contains 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 | |
$request_uri = $_SERVER['REQUEST_URI']; | |
$uri = preg_replace("/\/pukiwiki\.php/", "/", $request_uri, 1); | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: $uri"); | |
echo $uri; | |
?> |
This file contains 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
// 「シングルクオートで囲まれた箇所以外の文字列のみ置換する」 | |
// aaa を AAA に置換 | |
var target = "var aaa = 'UUUaaaXXX'; alert(aaa); "; | |
var replaced = target.replace( | |
/(aaa)|('[^']+')/g, // ここのaaaが検索文字列 | |
function (num, m1, m2, old) { | |
if (m1) return 'AAA'; // ここのAAAが置換先文字列 | |
return m2; | |
} | |
); |
This file contains 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
mshta.exe "javascript:window.onload=function(){k='Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\';r=new ActiveXObject('WbemScripting.SWbemLocator').ConnectServer(null, 'root\\default').Get('StdRegProv');m=r.Methods_.Item('EnumKey');p=m.InParameters.SpawnInstance_();p.hDefKey=0x80000002;p.sSubKeyName=k;s=r.ExecMethod_(m.Name, p).sNames.toArray();w=new ActiveXObject('WScript.Shell');for(i in s)try{document.write(w.RegRead('HKLM\\'+k+'\\'+s[i]+'\\DisplayName')+'<br>');}catch(e){}}" |
NewerOlder