Skip to content

Instantly share code, notes, and snippets.

View 79man's full-sized avatar
🎯
Focusing

MANOJ PILLAI 79man

🎯
Focusing
  • Bangalore, India
View GitHub Profile
@79man
79man / pfs_file_extract.sh
Created May 24, 2024 05:08
openssl pfx file
# Extract cert
openssl pkcs12 -in ./file.pfx -clcerts -nokeys -out file.crt
# Extract Key
openssl pkcs12 -in ./file.pfx -nocerts -nodes -out file.key
# Check cert
openssl x509 -in file.crt -text -noout
#Check Key
@79man
79man / ml_derivatives.py
Created November 9, 2023 10:52
Machine Learning Derivatives
import numpy as np
def predict(X, w):
return X * w
def loss (X, Y, w):
return np.average ((predict(X, w) - Y) ** 2)
def gradient(X, Y, w):
w_gradient = 2 * np.average (X * (predict(X, w) - Y))
@79man
79man / vlc_cli.bat
Last active April 6, 2024 15:57
VLC CLI commands
REM Join Videos with compatible codecs - This sometimes does not include audio for some videos.
REM IN case of such problems, try the next command
vlc.exe 1.mp4 2.mp4 --sout "#gather:std{access=file, dst=3.mp4}" --sout-keep
# Join Videos with compatible codecs - Audio also works
vlc.exe --advanced --sout "#gather:std{access=file,mux=ts,dst=3.mp4}" --no-sout-all --sout-keep 1.mp4 2.mp4
@79man
79man / python3-proxy-with-auth.py
Created March 23, 2022 12:25
Python3: use httplib with proxy authentication
import http.client, base64, sys, json
if len(sys.argv) < 2 :
print("Usage: " + sys.argv[0] + " username password");
quit()
proxy_details = {
"url" : "xxx.xxx.xxx.xxx", # replace with correct URI
"port" : 8080, # replace with correct port
"username" : sys.argv[1], # From command line argument
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@79man
79man / NSEQuote.js
Created April 26, 2021 15:07
Get Quote from NSE
fetch("https://www1.nseindia.com/live_market/dynaContent/live_watch/get_quote/ajaxGetQuoteJSON.jsp?symbol=dhfl", {method: "POST"}).then(function(response) {
return response.json();
}).then( (json) => console.log(json));
[{"name":"users","color":"Red","position":{"x":591,"y":356},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"id","type":"increments","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0}],"relation":[],"seeding":[]},{"name":"institutions","color":"Green","position":{"x":123,"y":106},"increment":true,"timestamp":true,"softdelete":false,"column":[],"relation":[{"extramethods":"","foreignkeys":"","name":"users","relatedmodel":"users","relationtype":"hasMany","usenamespace":"App"}],"seeding":[]}]
@79man
79man / bootstrapPopover.css
Last active October 21, 2016 14:07
Bootstrap Popover with Header and Footer
body {
font-family: medium-content-sans-serif-font,"Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Arial,sans-serif;
}
.popover-markup .popover-footer {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: 400;
line-height: 18px;
@79man
79man / Material Design (Radio Button, CheckBox).markdown
Last active November 20, 2015 16:08
Material Design (Radio Button, CheckBox)