Skip to content

Instantly share code, notes, and snippets.

@Illvili
Illvili / report.sh
Created January 26, 2024 18:36
PalWorld mem report with rcon
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cd /home/lighthouse/rcon
rss=$(ps aux | grep PalServer-Linux | grep -v grep | awk '{print $6"000"}')
max_mem=15000000000
percent=$(bc <<< "scale=2; $rss*100/$max_mem")
p_len=30
nth=$(($rss*$p_len/$max_mem))
p_full=##############################
@Illvili
Illvili / archive_log
Created September 16, 2013 08:33
ThinkPHP log archiver
#!/bin/sh
log_path="/home/www/[APP_NAME]/App/Runtime/Logs"
archive_path="/home/logs_archiver";
# some command
list_all_pattern="ls $log_path/13_*.log -1 | xargs -n 1 -I %_ basename %_ .log"
# archive files
Archive_Files () {
@Illvili
Illvili / ps-color.reg
Last active December 22, 2015 04:48
PowerShell Colors for http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs NOTICE: color format OOGGRRBB
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe]
; black 00000000
"ColorTable00"=dword:00202020
; darkgreen 00008000
"ColorTable01"=dword:004e4224
; darkred 00800000
"ColorTable02"=dword:001a5d14
; darkyellow 00808000
@Illvili
Illvili / qr-download.php
Last active October 29, 2015 09:55
APP QR Download Detect
<?php
// 地址配置
$iOSAPPStoreLink = '[iOS APP Store Link here]';
$AndroidLink = '[APK Link here]';
function redirect($url) {
header('Location: ' . $url);
exit();
}
@Illvili
Illvili / colors.css
Created May 29, 2015 01:21
moegirl-flatten-navbox-colors
.moegirl-flatten-navbox-wrapper > .moegirl-flatten-navbox-subgroup > .moegirl-flatten-navbox-title {
background: #ccccff;
}
.moegirl-flatten-navbox-wrapper > .moegirl-flatten-navbox-subgroup > .moegirl-flatten-navbox-content > .moegirl-flatten-navbox-subgroup > .moegirl-flatten-navbox-title {
background: #ddddff;
}
.moegirl-flatten-navbox-title {
background: #e6e6ff;
}
.moegirl-flatten-navbox-wrapper > .moegirl-flatten-navbox-subgroup {
public class DVD {
public String Title;
public DVD(String t) {
this.Title = t;
}
}
@Illvili
Illvili / moegirl-hide-common-box.js
Last active August 29, 2015 14:17
moegirl hide common box
$(function () {
if (window.mw && !!mw.config.get('wgNamespaceNumber')) return;
var contentParent = $('#mw-content-text');
if (!contentParent.length) contentParent = $('#content');
var commonBoxes = contentParent.find('.common-box');
if (!commonBoxes.length) return;
var commonBoxContainer = $('<div id="commonBoxContainer"><div id="commonBoxInfo"></div></div>').prependTo(contentParent);
var commonBoxList = $('<div id="commonBoxList"></div>').appendTo('#commonBoxInfo');
@Illvili
Illvili / html5mp3.php
Created March 3, 2015 03:44
MW mp3 resolve file url
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die();
/*******************************************************************************
* *
* HTML5MP3 Extension is base on FlashMP3 *
* *
* FlashMP3 Extension by Matthias Korn to embed a flash player with mp3-files *
@Illvili
Illvili / rank.all.js
Created March 2, 2015 07:19
Moegirl iOS APP Statics Rank Style
!function(){$(function(){$(".moe-group").each(function(){var o,r=$(this),e=parseInt(r.children(".moe-rank").text()),n=parseInt(r.children(".moe-prev").text());if(isNaN(n))o="fresh";else switch(Math.sign(e-n)){case-1:o="up";break;case 0:o="eq";break;case 1:o="down"}r.children(".moe-rank").addClass(o).prepend('<span class="rank-diff-icon"></span>')}),$("head").append('<style>.moe-rank .rank-diff-icon{position:relative;display:inline-block;margin-right:.5em;width:1em;height:1em;line-height:1em;border-radius:100%;text-align:center;color:#fff;vertical-align:-2px;box-sizing:border-box}.moe-rank.up .rank-diff-icon{background-color:#f94343}.moe-rank.down .rank-diff-icon{background-color:#11ba47}.moe-rank.eq .rank-diff-icon{background-color:#43a5f9}.moe-rank.fresh .rank-diff-icon{background-color:#f94343}.moe-group:nth-child(1) .rank-diff-icon{border:1px solid #eaad2b;background-color:#f4bc45;box-shadow:#f4bc45 0 0 5px}.moe-group:nth-child(2) .rank-diff-icon{border:1px solid #a0a0a0;background-color:#cdcdcd;box-shadow