Skip to content

Instantly share code, notes, and snippets.

View rac021's full-sized avatar
💭
https://github.com/rac021/jaxy

Yahiaoui Rachid rac021

💭
https://github.com/rac021/jaxy
View GitHub Profile
@rac021
rac021 / notes
Created December 17, 2016 12:19
notes
Node js notes
## Obtain Token and Invoke Service
package com.rac021.visitor ;
/**
*
* @author ryahiaoui
*/
import java.util.HashMap ;
import java.util.function.Function ;
@rac021
rac021 / openssl + curl for Self-Signed Certificate
Last active June 25, 2017 15:43
openssl + curl for Self-Signed Certificate
Download the Cerfiticate from the peer :
* openssl s_client -showcerts -connect 127.0.0.1:8545 </dev/null 2>/dev/null|openssl x509 -outform PEM > ~/my_certfile.pem
Tells curl to use the specified certificate file to verify the peer ( Using --cacert ) :
* curl -v --cacert ~/my_certfile.pem
-s -X POST https://127.0.0.1:8545/auth/realms/serenity/protocol/openid-connect/token \
#!/bin/bash
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install apt-transport-https ca-certificates -y
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
public static void main(String[] args) {
cartesianProduct ( Arrays.asList (
Arrays.asList( 1900, 1901, 1902 ) ,
Arrays.asList( Arrays.asList("R","Y") , Arrays.asList("RR","YY") ) ,
Arrays.asList(Arrays.asList("10") )
)
) ;
ONLINE DOCKER PLAY :
http://host2.labs.play-with-docker.com/p/b0f9134f-8b4c-4a95-b2f5-786b62acbbf7#b0f9134f_node1
This exemple is based on redmine container.
1- Fire up the postgres database container :
docker run -d --name test-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=redmine postgres
# start pulseaudio
$ docker run -d \
-v /etc/localtime:/etc/localtime \
-p 4713:4713 \ # expose the port
--device /dev/snd \ # sound
--name pulseaudio \
jess/pulseaudio
# start skype
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.1.3</version>
</dependency>
CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
try {
// Start the client
Display Only Duplicate lines using Bash :
1) On specifi column : cat *.* | cut -f 2 -d\ | sort | uniq -d
2) All row : cat *.* | sort | uniq -d
Delete duplicate rows and copy them to different files with a size limit