Skip to content

Instantly share code, notes, and snippets.

View ijunaid8989's full-sized avatar
🇵🇰
It may have escaped your notice but life isn't fair.

Junaid Farooq ijunaid8989

🇵🇰
It may have escaped your notice but life isn't fair.
  • Islamabad Pakistan
View GitHub Profile
@ijunaid8989
ijunaid8989 / pooled_crawler.ex
Created July 3, 2020 13:22 — forked from Manzanit0/pooled_crawler.ex
Web crawler which uses Floki and HTTPoison – does 5 request at a time
# Dependencies:
# {:httpoison, "~> 1.5"},
# {:floki, "~> 0.21.0"}
# {:benchee, "~> 1.0"} (Only for benchmarking – not in the script)
defmodule CrawlQueue do
use Agent
def start_link(urls) do
@ijunaid8989
ijunaid8989 / lsi.sh
Created June 17, 2020 04:58 — forked from demofly/lsi.sh
MegaCli wrapper for LSI MegaRAID for Debian/Ubuntu/RHEL/CentOS
#!/bin/bash
#
# originally came from Calomel.org
# https://calomel.org/megacli_lsi_commands.html
# LSI MegaRaid CLI
# lsi.sh @ Version 0.05
# Edited and optimized by demofly for rotational RAID arrays
#
# description: MegaCLI script to configure an Sound alarm disabled (server room too loud anyways)d monitor LSI raid cards.
class Maze
# Generate a maze.
def generate(width, height)
@width = width
@height = height
@maze = Array.new
for y in 0 ... @height
for x in 0 ... @width
@maze[y * @width + x] = 1
[
{
"id": 1528965627,
"Anger": 0,
"Disgust": 0,
"FaceDetected": 0,
"Fear": 0,
"Happiness": 0,
"LargeFaceDetected": 0,
"MotionDetected": 0,
@ijunaid8989
ijunaid8989 / 0-font-awesome-bootstap-phoenix.md
Created January 27, 2018 13:43 — forked from mbenatti/0-font-awesome-bootstap-phoenix.md
Installing Bootstrap + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@ijunaid8989
ijunaid8989 / colone.sh
Created January 16, 2018 09:52
cloning db from herokuo
#!/bin/sh
read -p "This will delete the local database 'evercam_live' and recreate
it from the live database. Are you sure you want to continue? (Y/N): " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
# Delete and create local 'evercam_live' database
# version 1
for counter in 1..100
if (counter % 3 == 0) && (counter % 5 == 0)
puts 'Trakstar'
elsif (counter % 3 == 0)
puts 'Trak'
elsif (counter % 5 == 0)
puts 'Star'
else
module Enumerable # or require 'facets/enumerable/frequency'
def frequency
each_with_object(Hash.new(0)) { |item, counter| counter[item] += 1 }
end
end
def anagrams?(s1, s2)
frequency = proc { |s| s.gsub(/\s+/, "").downcase.chars.frequency }
frequency.(s1) == frequency.(s2)
end
{
"tags": [],
"envelope": {
"sender": "support@evercam.io",
"transport": "smtp",
"targets": "marco@evercam.io"
},
"storage": {
"url": "https://sw.api.mailgun.net/v3/domains/evercam.io/messages/eyJwIjpmYWxzZSwiayI6ImRkZGNkYjAyLTNkMjUtNDFjMS05NWZjLWZlMTA1ZTBhZmY1MCIsInMiOiJhN2QwMWM0ZDc2IiwiYyI6InRhbmtiIn0=",
"key": "eyJwIjpmYWxzZSwiayI6ImRkZGNkYjAyLTNkMjUtNDFjMS05NWZjLWZlMTA1ZTBhZmY1MCIsInMiOiJhN2QwMWM0ZDc2IiwiYyI6InRhbmtiIn0="
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Network device 'pptp-vpnconn' link is down
Mon Dec 18 15:51:00 2017 daemon.notice pppd[19043]: Connection terminated.
Mon Dec 18 15:51:00 2017 local1.info hotplug-gsmstate[29590]: envACT: ifdown
Mon Dec 18 15:51:00 2017 local1.info hotplug-gsmstate[29590]: envINT: vpnconn
Mon Dec 18 15:51:00 2017 daemon.info pppd[19043]: Exit.
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Interface 'vpnconn' is now down
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Interface 'vpnconn' is setting up now
Mon Dec 18 15:51:00 2017 user.notice root: stopping ntpclient
Mon Dec 18 15:51:01 2017 daemon.info pppd[29688]: Plugin pptp.so loaded.
Mon Dec 18 15:51:01 2017 daemon.info pppd[29688]: PPTP plugin version 1.00