Skip to content

Instantly share code, notes, and snippets.

View duyet's full-sized avatar

duyet duyet

View GitHub Profile
@duyet
duyet / Login HT.txt
Created July 7, 2015 17:43
HackingTeam Data - c.pozzi - Truecrypt Volume
\\fileserver\FileServer
certmgr.msc
pippo123!
sito veam
[email protected]
Veeam4HT
VMWare Fuzzy
@duyet
duyet / classify1.py
Last active August 29, 2015 14:24
Apache Spark Machine Learning
from pyspark import SparkContext
from pyspark.ml import Pipeline
from pyspark.ml.classification import LogisticRegression
from pyspark.ml.feature import HashingTF, Tokenizer
from pyspark.sql import Row, SQLContext
sc = SparkContext(appName="SimpleTextClassificationPipeline")
sqlContext = SQLContext(sc)
@duyet
duyet / insert_jquery_to_chrome_console.js
Created August 10, 2015 06:46
Require jQuery to console.
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-18218315-47', 'auto');
ga('send', 'pageview');
</script>
@duyet
duyet / web-servers.md
Last active September 7, 2015 16:16 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
/**
* Put forget password
*/
exports.forgetPassword = function(req, res, next) {
var email = String(req.body.email);
User.findOne({
email: email
}, function(err, user) {
console.log(err, !user);
@duyet
duyet / thread_1.c
Last active October 9, 2015 17:09
Bài tập nhập xuất C
#include <stdio.h>
#include <math.h>
int main (void)
{
int a, b, c, d;
while (1) {
printf("Nhap 4 so:");
scanf("%d%d%d%d",&a, &b, &c, &d);
@duyet
duyet / mysqlbackup.sh
Created October 18, 2015 11:44 — forked from nicdoye/mysqlbackup.sh
Backup your OpenShift MySQL database. My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
mkdir ~/app-root/data/tmp
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql
var data = [
{name: "otp_options[otp_option_value][5][otp]", value: "617"},
{name: "otp_options[otp_option_value][10][otpx]", value: "617"},
{name: "otp_options[otp_option_value][5][otpy]", value: "617"}
];
var data = _.map(data, function(x) {
var tmp = x.name.match(/[A-z_-]+\[[^\]]+\]\[[^\]]+\]\[([^\]]+)\]/);
var key = tmp[1] || '';
SELECT
t1.id as level_1,
t4.level_2,
t4.level_3
FROM
`categories` t1
LEFT JOIN (
SELECT
t2.id as level_2,