Skip to content

Instantly share code, notes, and snippets.

View mnzit's full-sized avatar
🎯
Focusing

Manjit Shakya mnzit

🎯
Focusing
View GitHub Profile
@mnzit
mnzit / BulkUpdatePayload
Created November 2, 2022 02:18
Bulk Update Payload
{
"actionName": "Job",
"actionData": {
"teamName": 3011,
"primarySkill": 1022,
"secondarySkill": [
1033,
1021,
1025
]
public static String convertZipFileToBaseEncodeString() {
File originalFile = new File("multifiles.zip");
String encodedBase64 = null;
try {
FileInputStream fileInputStreamReader = new FileInputStream(originalFile);
byte[] bytes = new byte[(int) originalFile.length()];
fileInputStreamReader.read(bytes);
encodedBase64 = new String(Base64.encodeBase64(bytes));
} catch (FileNotFoundException e) {
e.printStackTrace();
@mnzit
mnzit / video-convert-mp4.java
Created July 25, 2022 10:14 — forked from balvinder294/video-convert-mp4.java
Code for video conversion with JAVA
Convert a video to Mp4(MPEG-4 AVC) and AAC audio
/* Step 1. Declaring source file and Target file */
File source = new File("source.avi");
File target = new File("target.mp4");
/* Step 2. Set Audio Attrributes for conversion*/
AudioAttributes audio = new AudioAttributes();
audio.setCodec("aac");
// here 64kbit/s is 64000
<div
fxLayout="row"
fxLayout.xs="column"
fxFlexFill >
<div fxFlex="33.33" class="sec1" fxFlex.xs="100">
first-section
</div>
<div fxFlex="33.33" class="sec2" fxFlex.xs="100">
second-section
[
  {
    "companyImageUrl": "https://merojob.com/media/cache/30/e9/30e9b3cdc11493eca79d3dc4764092c7.jpg",
    "title": "Senior Software Engineer",
    "company": "XCorp",
    "companyAddress": "Kathmandu Remote work",
    "keySkills": [
      "React (Client Side) And Aws Node.Js Java Ror Python",
      "React (Client Side) And Aws",
      "Node.Js",
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.2.4</version>
</dependency>
@mnzit
mnzit / disconnect-dc.sh
Created June 12, 2021 03:30 — forked from a-robinson/disconnect-dc.sh
Docker compose file for 3-datacenter cockroachdb cluster with 2 nodes in each datacenter
docker network disconnect "${PWD##*/}_shared" roach-4
docker network disconnect "${PWD##*/}_shared" roach-5
@mnzit
mnzit / DatabaseConfiguration.java
Created April 5, 2021 03:41 — forked from himanshuvirmani/DatabaseConfiguration.java
SpringBoot Multiple DB Connections using Routing DataSource
@Configuration
@EnableJpaAuditing(dateTimeProviderRef = "dateTimeProvider")
@EnableJpaRepositories("com.sample.repository")
@EnableTransactionManagement
public class DatabaseConfiguration implements EnvironmentAware {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
private RelaxedPropertyResolver dataSourcePropertyResolver;
private RelaxedPropertyResolver slaveDataSourcePropertyResolver;
@mnzit
mnzit / generate_rsa_keypair.sh
Created December 28, 2020 05:00 — forked from nghiaht/generate_rsa_keypair.sh
Generate RSA keypair (public, private + pkcs8) using openssl command
# Private key
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
# Public key
openssl rsa -pubout -in private.pem -out public_key.pem
# Private key in pkcs8 format (for Java maybe :D)
openssl pkcs8 -topk8 -in private.pem -out private_key.pem
## nocrypt (Private key does have no password)
@mnzit
mnzit / nginx.conf
Created November 8, 2020 05:34 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048