Skip to content

Instantly share code, notes, and snippets.

View rajibahmed's full-sized avatar
🚴‍♂️
Life is fine !

Rajib Ahmed rajibahmed

🚴‍♂️
Life is fine !
  • Stockholm
View GitHub Profile
# Create Key
openssl genrsa -des3 -out logstash.key 1024
sudo openssl genrsa -des3 -out logstash.key 1024
# Create CSR
openssl req -new -key logstash.key -out logstash.csr
sudo openssl req -new -key logstash.key -out logstash.csr
# Remove password from key
sudo openssl rsa -in logstash.key.org -out logstash.key
# Create certificate
sudo openssl x509 -req -days 365 -in logstash.csr -signkey server.key -out logstash.crt
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"
@rajibahmed
rajibahmed / slim-redux.js
Created May 13, 2018 07:55 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@rajibahmed
rajibahmed / App.jsx
Created December 24, 2019 14:54
SAP with all react hooks
import React, { useState, useEffect, useContext, useReducer } from "react";
const api = "https://randomuser.me/api/?results=2";
const NEXT_PAGE = "NEXT_PAGE";
const ThemeContext = React.createContext(null);
const Users = ({ users, children }) => {
const themeCxt = useContext(ThemeContext);
return users.map(user => {
@rajibahmed
rajibahmed / redux-most-example.js
Created December 29, 2019 17:53
Practicing redux most stuff
import React from "react";
import { compose } from "ramda";
import { createStore } from "redux";
import { Provider, connect, useSelector } from "react-redux";
import * as most from "most";
import {
select,
createEpicMiddleware,
createStateStreamEnhancer
} from "redux-most";
@rajibahmed
rajibahmed / i18n.ts
Created August 1, 2021 17:19
Simple i18n with typescript
const translations = {
en: {
searchLable: 'Add to',
addProduct: 'Add product',
menuHeader: 'MENU',
searchHeader: 'SEARCH',
},
sv: {
searchLable: 'Lägg till vara',
addProduct: 'Lägg till',