Skip to content

Instantly share code, notes, and snippets.

@masatokawano
masatokawano / recursive_unzip.sh
Created September 21, 2018 07:13
unzip zip file recursively.
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
# or
find . -name "*.zip" | xargs -P 5 -I fileName sh -c 'unzip -o -d "$(dirname "fileName")/$(basename -s .zip "fileName")" "fileName"'
@masatokawano
masatokawano / sample.coffee
Created August 1, 2018 03:33
change column data font color on datatables
ready = ->
table = $('#computers').dataTable({
"columnDefs": [ {
"targets": [ 3 ],
"createdCell": (td, cellData, rowData, row, col) ->
$(td).css 'color', 'red'
} ]
});
@masatokawano
masatokawano / computers.coffee
Last active June 8, 2018 02:46
Customize jquery datatables with coffeescript. csv export filename with date.
ready = ->
table = $('#computers').dataTable({
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>><'row'<'col-md-6'><'col-md-6'>><'row'<'col-md-12't>><'row'<'col-md-12'ip>>",
"buttons": [
extend: 'csv',
text: '<strong>CSV</strong> file download',
filename: getfilename,
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11 ]
}
[Unit]
Description=Unbound DNS server
Documentation=man:unbound(8)
After=network.target
Before=nss-lookup.target
Wants=nss-lookup.target
[Service]
Type=notify
Restart=on-failure
dependency
libbison-dev libbsd0 libcroco3 libevent-2.1-6 libevent-core-2.1-6 \
libevent-dev libevent-extra-2.1-6 libevent-openssl-2.1-6 \
libevent-pthreads-2.1-6 libexpat1 libexpat1-dev \
libfile-stripnondeterminism-perl libfreetype6 libfstrm-dev libfstrm0 \
libglib2.0-0 libgmp-dev libgmpxx4ldbl libgraphite2-3 libharfbuzz0b \
libicu-le-hb0 libicu60 libmagic-mgc libmagic1 libmpdec2 libpipeline1 \
libprotobuf-c-dev libprotobuf-c1 libprotobuf10 libprotoc10 libpython-dev \
libpython-stdlib libpython2.7 libpython2.7-dev libpython2.7-minimal \
server:
# number of threads to create. 1 disables threading.
num-threads: 8
# number of ports to allocate per thread, determines the size of the
# port range that can be open simultaneously. About double the
# num-queries-per-thread, or, use as many as the OS will allow you.
outgoing-range: 4096
# number of incoming simultaneous tcp buffers to hold per thread.
incoming-num-tcp: 1000
# use SO_REUSEPORT to distribute queries over threads.