Skip to content

Instantly share code, notes, and snippets.

View 0xHexE's full-sized avatar
:electron:
Working

Horizon 0xHexE

:electron:
Working
View GitHub Profile
@0xHexE
0xHexE / config
Created June 15, 2020 08:51
Disable nginx TLS 1.0 and 1.1
server {
...
listen 443 ssl;
ssl_protocols TLSv1.2;
...
}
@0xHexE
0xHexE / nginx-headers.conf
Last active June 15, 2020 08:50
Security checklist
add_header Strict-Transport-Security: max-age=31536000 ; includeSubDomains;
# TODO: Change hash more info https://owasp.org/www-project-secure-headers/
add_header Public-Key-Pins: pin-sha256="d6qzRu9zOECb90Uez27xWltNsj0e1Md7GkYYkVoZWmM="; pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="; report-uri="http://example.com/pkp-report"; max-age=10000; includeSubDomains;
# disable it until it is a special requirement
add_header X-Frame-Options: deny
# If you have report url then =http://[YOURDOMAIN]/your_report_URI
add_header X-XSS-Protection "1; mode=block" always;
# Prevent the browser from interpreting files as a different MIME type
add_header X-Content-Type-Options "nosniff" always;
# Customize Content-Security-Policy according to your need to make it more strict for better effect.
export function ExampleForm() {
const [intitialValue, setIntitalValue] = useState(null);
useEffect(() => {
setTimeout(() => {
setIntitalValue({
email: 'This is my async email',
});
}, 3000);
version: '3.6'
services:
postgres:
image: postgres
restart: always
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak

Keybase proof

I hereby claim:

  • I am httpsomkar on github.
  • I am httpsomkar (https://keybase.io/httpsomkar) on keybase.
  • I have a public key ASBNhI36wkdNBJoCcNlqDo86DxtmUitBBN6i1Kgutke4two

To claim this, I am signing this object:

@0xHexE
0xHexE / init-single-node-ceph.sh
Last active March 10, 2020 20:26 — forked from kofemann/init-single-node-ceph.sh
Single node CEPH setup
#
# Enable CEPH repos as described at http://ceph.com/docs/master/install/get-packages/#rpm
# Install ceph-deploy package
#
apt update
apt install ceph-deploy -y
export DATA_DEV=vdb
export FS_TYPE=xfs
@0xHexE
0xHexE / install.sh
Last active February 15, 2021 22:48
Install docker in ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@0xHexE
0xHexE / code.js
Created August 24, 2019 04:17
CSV to JSON in NodeJS
// npm i papaparse --save
const FILE_NAME = 'FILE_PATH';
const data = require('papaparse').parse(require('fs').readFileSync(FILE_NAME).toString(), { header: true }).data;
fs.writeFileSync('test.json', JSON.stringify(data));
@0xHexE
0xHexE / river.cpp
Last active April 4, 2019 02:22
C++ Code for the River finding
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int number_of_words;
cout << "Enter the number of words: ";
@0xHexE
0xHexE / script-loader.service.ts
Created July 22, 2018 09:34
Load dynamically file in the angular using service
import { Injectable } from '@angular/core';
@Injectable()
export class ScriptLoaderService {
constructor() { }
loadScript(url: string) {
return this.load(url, 'script');
}