Skip to content

Instantly share code, notes, and snippets.

View sharif2008's full-sized avatar
🎯
Focusing

Md. Shariful Islam sharif2008

🎯
Focusing
  • Dhaka
View GitHub Profile
@sharif2008
sharif2008 / SignedXml.java
Created November 2, 2022 13:34 — forked from rponte/SignedXml.java
How to sign a XML with private key certificate in Java (using Java Key Store)
package br.com.mdias.rponte.signature;
import java.util.Base64;
/**
* Represents a signed XML
*/
public class SignedXml {
private String content;
@sharif2008
sharif2008 / pkcs10Generator.js
Created October 30, 2022 15:24 — forked from dmikey/pkcs10Generator.js
Simple way to generate certificate signing request (CSR) with X.509 using Javascript
import * as asn1js from 'asn1js';
import { getCrypto, getAlgorithmParameters, CertificationRequest, AttributeTypeAndValue } from 'pkijs/build'
import { arrayBufferToString, toBase64 } from 'pvutils';
//https://github.com/PeculiarVentures/PKI.js/blob/31c10e9bb879cac59d710102adf4fd7bd61cd66c/src/CryptoEngine.js#L1300
const hashAlg = 'SHA-256'
const signAlg = 'ECDSA'
/**
* @example
* createPKCS10({ enrollmentID: 'user1', organizationUnit: 'Marketing', organization: 'Farmer Market', state: 'M', country: 'V' })
@sharif2008
sharif2008 / multiple_ssh_setting.md
Created November 16, 2020 11:53 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@sharif2008
sharif2008 / example.md
Created October 16, 2019 07:18 — forked from devdrops/example.md
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@sharif2008
sharif2008 / mysql-docker.sh
Created October 16, 2019 07:18 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@sharif2008
sharif2008 / mysql-docker.sh
Created October 16, 2019 07:17 — forked from nshtg/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
gunzip < backup.sql.gz | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
bunzip2 < backup.sql.bz2 | docker exec -i CONTAINER /usr/bin/mysql -u root -pPASSWORD DATABASE
@sharif2008
sharif2008 / docker-compose-node3.yml
Created September 23, 2019 06:19 — forked from kctam/docker-compose-node3.yml
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org3.example.com:
extends:
file: docker-compose-base.yml
service: peer
@sharif2008
sharif2008 / docker-compose-node2.yml
Created September 23, 2019 06:19 — forked from kctam/docker-compose-node2.yml
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org2.example.com:
extends:
file: docker-compose-base.yml
service: peer
@sharif2008
sharif2008 / docker-compose-node1.yml
Created September 23, 2019 06:19 — forked from kctam/docker-compose-node1.yml
3node2channel setup
version: '2'
networks:
fabric:
services:
peer0.org1.example.com:
extends:
file: docker-compose-base.yml
service: peer
@sharif2008
sharif2008 / docker-compose-orderer.yml
Created September 23, 2019 06:19 — forked from kctam/docker-compose-orderer.yml
3node2channel setup
version: '2'
networks:
fabric:
services:
orderer.example.com:
extends:
file: docker-compose-base.yml