Skip to content

Instantly share code, notes, and snippets.

View absk1317's full-sized avatar
🎯
Focusing

abhishek verma absk1317

🎯
Focusing
View GitHub Profile
Do all in https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
iptables -I FORWARD -i tun0 -o eth0 \
-s 10.8.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED \
-j ACCEPT
iptables -t nat -I POSTROUTING -o eth0 \
-s 10.8.0.0/24 -j MASQUERADE
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active March 27, 2024 21:24
crack activate Office on mac with license file
@culttm
culttm / axios.refresh_token.js
Created October 5, 2017 18:46
axios interceptors for refresh token
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
originalRequest._retry = true;
import React from "react"
import Time from "react-time"
import { OverlayTrigger, Popover } from "react-bootstrap"
import { CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Surface, Symbols, XAxis, YAxis } from "recharts"
import "./style/StudentEngagement.less"
import { i18n } from "../services/Messages/Messages"
class StudentEngagementLineChart extends React.Component {
@emiloberg
emiloberg / GaugeChart.js
Last active February 13, 2024 14:30
Gauge Chart with React Recharts (http://recharts.org)
import React from 'react';
import { Sector, Cell, PieChart, Pie } from 'recharts';
const GaugeChart = () => {
const width = 500;
const chartValue = 180;
const colorData = [{
value: 40, // Meaning span is 0 to 40
color: '#663399'
}, {
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@longlostnick
longlostnick / uploads_controller.rb
Created June 17, 2014 18:20
Rails JSON file upload with carrierwave (from base64 string)
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private
@sudara
sudara / puma.monitrc
Last active November 3, 2023 12:03
Example config needed to use monit with puma, monitoring workers for mem.
# this monit config goes in /etc/monit/conf.d
check process puma_master
with pidfile /data/myapp/current/tmp/puma.pid
start program = "/etc/monit/scripts/puma start"
stop program = "/etc/monit/scripts/puma stop"
group myapp
check process puma_worker_0
with pidfile /data/myapp/current/tmp/puma_worker_0.pid
@Stanback
Stanback / nginx.conf
Last active February 4, 2022 18:05
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
# === EDITOR ===
Pry.editor = 'vim'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
Pry.commands.alias_command 'r!', 'reload!' rescue nil
Pry.config.color = true