Skip to content

Instantly share code, notes, and snippets.

@minorugh
minorugh / upftp.pl
Last active April 10, 2019 21:31
upftp SSL対応版
#!/usr/bin/perl
#
# This is UpFtp, Version 1.3
# Copyright (C) 2000,2003,2006,2017 by Hiroshi Yuki.
# http://www.hyuki.com/upftp/
# https://gist.github.com/hyuki0000/f58ccabccba37b93dbb5823d4f019341
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
# Add [my $ home = $ ENV {"HOME"}] to share on Mac & Linux at 20170713 by Minoru Yamada.
#
@minorugh
minorugh / README.md
Last active September 1, 2021 10:20
dvpd.sh

dvpd.sh

Yatexからdvipdfmxを使ってpdfを生成したあと自動的にPreview.appで開くためのスクリプト。

dvpd.shを /usr/local/bin とかのPATHの通った処に置く。

Linux 環境で使うときは、open -a Preview.app の部分をLinuxのアプリケーション起動コマンドに書き換える必要がある。

@minorugh
minorugh / get-end-month.pl
Last active August 30, 2021 01:52
get-end-month.pl
#%PERL
use strict;
use warnings;
print "月の末日を取得する。\n";
my $end_of_this_month = end_of_month(2017, 12);
print "2017年12月の月末日は$end_of_this_month日です。\n";
# 月末日を求める関数。
sub end_of_month {
@minorugh
minorugh / charactor-limited.pl
Last active April 10, 2019 23:53
charactor-limited.pl
# %PERL
my $main = '凡そ天下に去来ほどの小さな墓に参りけりだぞ';
$length = length $main;
if ($length > 40){&error("文字数が20文字を超えています。余分な空白が入っていませんか?");
}else{
print $length;
}
@minorugh
minorugh / auto-login for xfce4
Last active September 22, 2019 21:56
auto-login for xfce4 on linux
/etc/lightdm/lightdm.conf
[Seat:*]
pam-service=lightdm
pam-autologin-service=lightdm-autologin
autologin-user=username
autologin-user-timeout=0
session-wrapper=/etc/X11/Xsession
@minorugh
minorugh / browse-url-wsl.el
Last active November 4, 2022 21:48
Emacs on WSL open links in Windows web browser
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Emacs on WSL open links in Windows web browser
;; https://adam.kruszewski.name/2017/09/emacs-in-wsl-and-opening-links/
(when (getenv "WSLENV")
(let ((cmd-exe "/mnt/c/Windows/System32/cmd.exe")
(cmd-args '("/c" "start")))
(when (file-exists-p cmd-exe)
(setq browse-url-generic-program cmd-exe
browse-url-generic-args cmd-args
browse-url-browser-function 'browse-url-generic
@minorugh
minorugh / get-month.pl
Last active March 9, 2020 00:14
get-month.pl
# get-month.pl
my ($sec,$min,$hour,$day,$mon,$year,$wdy,$yday,$isdst)=localtime;
$mon++;
$year += 1900;
if($mon < 10){$mon = "0$mon";}
if($day < 10){$day = "0$day";}
my $month = "$year$mon";
my $kyou = "$year$mon$day";
@minorugh
minorugh / getwday.pl
Last active August 31, 2021 09:12
getwday
#### 締切りチェック (WEB句会用に追加)
($sec,$min,$hour,$day,$mon,$year,$wdy,$yday,$isdst)=localtime;
$mon++;
my $monn = $mon;
$year += 1900;
if($mon < 10){$mon = "0$mon";}
if($day < 10){$day = "0$day";}
if($hour < 10){$hour = "0$hour";}
if($min < 10){$min = "0$min";}
@minorugh
minorugh / permission.md
Last active September 1, 2021 11:14
パーミッション早見表

パーミッション文字と8進数の対応

文字列 8進数 意味
r 4 読み込み可能
w 2 書き込み可能
x 1 実行権限
- 0 権限なし
@minorugh
minorugh / search_csv.cgi
Last active September 2, 2021 00:25
ファイル簡易検索(CSV用 )
#!/usr/bin/perl
# Copyright (C) 2001-2003 All right reserved by Shinya Kondo ( CGI KON )
require "cgi-lib.pl";
# 検索用関数
sub Search_Pattern
{