Skip to content

Instantly share code, notes, and snippets.

View Svastikkka's full-sized avatar
🏛️
Working from Gift City

Manshu Sharma Svastikkka

🏛️
Working from Gift City
View GitHub Profile

Curl with Java KeyStore

Curl doesn't have support for java keystore file, so therefor the file should be converted to a PEM format. It consists of the following multiple steps:

  1. Convert keystore to p12 file
  2. Convert p12 file to pem file
  3. Run curl command with pem files

Convert keystore to p12 file

keytool -importkeystore -srckeystore truststore.jks -destkeystore truststore.p12 -srcstoretype JKS -deststoretype PKCS12
t=int(input())
for i in range(t):
h,p=map(int,input().split())
while h>0:
h = h - p
p = p // 2
if p>h:
print(1)
break
elif p==0 and h!=0:
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@Svastikkka
Svastikkka / postfix-gmail-macos.md
Created December 14, 2020 11:02 — forked from giovanigenerali/postfix-gmail-macos.md
Postfix Gmail relay on macOS Sierra & macOSHigh Sierra

Postfix Gmail relay on macOS Sierra & macOSHigh Sierra

1 - Create a file to store our credentials:

sudo vim /etc/postfix/sasl_passwd

2 - Add something like this:

@Svastikkka
Svastikkka / Search my gists.md
Created October 2, 2020 21:25 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@Svastikkka
Svastikkka / NPM commands cheat sheet.md
Last active December 7, 2020 11:39
NPM commands cheat sheet

Npm has a lot of commands, lets make a cheat sheet!

Community Features

  • adduser (alias: add-user | login)

    Create or Login into the npm server.

npm adduser

@Svastikkka
Svastikkka / nodejs-cheatsheet.js
Created December 7, 2020 05:23 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
def BinarySearch(a,x,si,ei):
if si>ei:
return -1
mid=(si+ei)//2
if a[mid]==x:
return mid
elif a[mid] >x:
ei =mid-1
return BinarySearch(a,x,si,ei)
elif a[mid] <x:
class Node:
def __init__(self,data):
self.data=data
self.next=None
class LinkedList:
def __init__(self):
self.head=None
self.tail=None
def inputLL(self,arr):
def multiplyList(myList):
# Multiply elements one by one
result = 1
for x in myList:
result = result * int(x)
return result
def solve(n):
c=0