Skip to content

Instantly share code, notes, and snippets.

View DozenCoder's full-sized avatar

DozenCoder

View GitHub Profile
@DozenCoder
DozenCoder / jenkins-plugins.md
Last active August 3, 2020 04:42 — forked from noqcks/jenkins-plugins.md
How to get a complete plugin list from jenkins (with version)

I need a way to get a list of plugins so that I can use them with docker jenkins in the format <plugin>:<version>

1. get the jenkins cli.

The jenkins CLI will allow us to interact with our jenkins server from the command line. We can get it with a simple curl call.

curl 'localhost:8080/jnlpJars/jenkins-cli.jar' > jenkins-cli.jar
@DozenCoder
DozenCoder / answer.md
Created August 16, 2019 11:08
Answer for twu-biblioteca-assignment

1.Who checked out the book 'The Hobbit’?

select name
from member
where id in (select member_id
             from book
                      inner join checkout_item on checkout_item.book_id = book.id
             where book.title = "The Hobbit");

Anand Beck

import java.io.Serializable
import org.apache.spark.HashPartitioner
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.expressions.UserDefinedFunction
import org.apache.spark.sql.{DataFrame, SparkSession}
import org.apache.spark.storage.StorageLevel
import org.apache.spark.sql.functions._
722 297 1072 1206 1072 1136 374 924 358 952 1206 952 130 607 256 226 282 226 1234 558 1144 876 130 373 130 447 148 952 1136 148 954 944 1121 130 504 226 558 413 558 413 131 804
201 836 479 688 479 688 768 1293 670 1293 554 141 862 616 670 49 944 539 944 1166 944 173 1166 173 170 6 49 670 49 539 670 1030 692 862 1030 522 1048 1306 1085 1388 862 1364
934 823 312 1118 125 1118 1308 10 1010 1308 1317 483 1317 692 1317 1293 1317 6 862 670 1025 1030 1025 1030 1048 1025 387 670 173 1166 173 892 61 508 447 130 607 135 413 848 944 692
1260 982 79 841 79 841 6 841 862 522 1317 49 483 577 173 1166 173 944 670 944 692 679 186 679 1163 137 275 493 924 1097 952 1097 273 462 7 1108 64 1108 713 515 756 1097
840 462 1067 21 373 21 373 668 965 56 99 107 135 756 1097 130 717 130 717 21 373 370 1097 515 1386 1206 130 413 944 679 1166 0 1107 717 297 717 357 21 1097 137 1136 148
106 592 1067 668 915 499 1086 610 1187 1020 1187 183 105 980 692 131 503 1365 876 1067 1097 130 1115 447 957 282 108 874 607 282 1234 957 688 7 1234 479 5
@DozenCoder
DozenCoder / similarity.py
Last active April 27, 2018 05:33
用户相似度计算1
# similarity method 1
sim = 0
sim = sum([math.pow(r1[i] - r2[i]) for i in item_comm])/len(item_comm)
sim = math.sqrt(sim)
sim = 1.0 - math.tanh(sim)
# similarity method 2
max_comm = min(len(user1), len(user2))
sim = sim * item_comm / max_comm
@DozenCoder
DozenCoder / translate_copyed_word.py
Last active October 8, 2017 06:17
Linux下划词翻译脚本
# apt-get install dict-cli
# apt-get install xclip
import subprocess
word = subprocess.check_output(['xclip', '-out']).decode("utf-8")
result = subprocess.check_output(['dict', word]).decode("utf-8")
subprocess.call(['notify-send', result])
@DozenCoder
DozenCoder / psmouse.sh
Created July 17, 2017 07:11
开机根据是否外接鼠标禁用或启用触控板
# put this script into /etc/rc.local, before exit 0.
if [ $(ls -l /dev/input/by-id/*-mouse | wc -l) -gt 1 ]; then rmmod psmouse; fi