This file contains hidden or 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
#!/usr/bin/python3 | |
# The alternative script of "cat files|sort|uniq -c|sort -r -n". | |
import marisa | |
import sys | |
import io | |
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') |
This file contains hidden or 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
--- webconsole.php~ | |
+++ webconsole.php | |
@@ -561,12 +561,27 @@ | |
2 => array('pipe', 'w') // STDERR | |
); | |
- $process = proc_open($command . ' 2>&1', $descriptors, $pipes); | |
+ $process = proc_open(escapeshellcmd($command), $descriptors, $pipes); | |
if (!is_resource($process)) die("Can't execute command."); | |
This file contains hidden or 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
#!/usr/bin/perl | |
use strict; | |
&main(); | |
sub main { | |
open( my $ph, 'dpkg --status |' ) or die; | |
my %package; | |
my %depended; |
This file contains hidden or 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
#!/usr/bin/perl | |
=head1 NAME | |
ldap-health-check | |
=head1 INSTALL | |
First, put this script into /usr/local/bin/ and make it executable. |
This file contains hidden or 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
#!/usr/bin/perl | |
=head1 NAME | |
postfix_incoming_mailstats - Plugin to monitor the number of mails | |
received by postfix | |
=head1 DEFAULT CONFIGURATION | |
[postfix_incoming_mailstats] |
This file contains hidden or 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
auto lo | |
iface lo inet loopback | |
# The 1st network of this host is 192.0.2.0/24. | |
# This host mainly uses the 1st network to communicate the Internet. | |
allow-hotplug eth0 | |
iface eth0 inet static | |
address 192.0.2.30 | |
netmask 255.255.255.0 | |
network 192.0.2.0 |
This file contains hidden or 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
# Ansible task to install Azure CLI. | |
# These steps are re-implementation of the procedure descrbed at | |
# https://docs.microsoft.com/cli/azure/install-azure-cli-apt | |
- name: Install packages required by Azure CLI | |
apt: | |
name: ['ca-certificates', 'curl', 'apt-transport-https', 'lsb-release', 'gnupg'] | |
state: present | |
- name: Add Azure CLI repository key |
This file contains hidden or 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
from chainer import function, training | |
from chainer import reporter as reporter_module | |
from chainer.dataset import convert | |
from collections import defaultdict | |
class PreciseEvaluator(training.extensions.Evaluator): | |
""":class:`chainer.training.extensions.Evaluator` module uses | |
:func:`chainer.reporter.compute_mean` to calculate the mean | |
accuracy and the mean loss over the multiple mini batches. |
This file contains hidden or 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
--- a/swig/MeCab.i | |
+++ b/swig/MeCab.i | |
@@ -3,6 +3,7 @@ | |
%{ | |
#include "mecab.h" | |
+#define SWIG_PYTHON_STRICT_BYTE_CHAR | |
/* Workaround for ruby1.9.x */ | |
#if defined SWIGRUBY | |
#include "ruby/version.h" |
This file contains hidden or 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
$ git clone [email protected]:nlp-ja-team/mecab.git | |
$ cd mecab | |
$ gbp buildpackage -us -uc --git-dist=stable --git-arch=amd64 | |
(snip) | |
dpkg-genchanges: warning: debian/changelog(l8): found end of file where expected more change data or trailer | |
dpkg-genchanges: warning: unknown information field '' in input data in parsed version of changelog | |
dpkg-genchanges: error: unknown is not a valid version | |
dpkg-buildpackage: error: dpkg-genchanges subprocess returned exit status 2 |