Skip to content

Instantly share code, notes, and snippets.

View dapseen's full-sized avatar
🏠
Working from home

Adedapo Ajuwon dapseen

🏠
Working from home
View GitHub Profile
@dapseen
dapseen / account_id.install
Created September 25, 2017 17:45
generating unique account ID -- Drupal 7
<?php
/**
* implements hook_schema()
*/
function cribs_schema()
{
$schema['cribs'] = array(
'description' => 'table holding account id of users',
@dapseen
dapseen / rewrite_result.css
Last active July 22, 2024 20:38
drupal 7 slick export
#date-created span{
position:absolute;
top:160px;
font-size: .75em;
width: 76%;
padding: 2em 1.5em 1em;
background-image: linear-gradient(to bottom,rgba(255,255,255,0),rgba(0,0,0,.75));
color: #fff;
font-style: italic;
font-weight: 300;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
@dapseen
dapseen / .bashrc
Created April 17, 2019 11:08
setup time for tellvictor project
alias tell_proj="cd /var/www/html/tellvictor"
@dapseen
dapseen / xargs.sh
Created November 16, 2019 11:09
using find with xargs
find . -name "*.png" | xargs rm
#https://shapeshed.com/unix-xargs/
@dapseen
dapseen / sidecar.yaml
Created December 8, 2019 02:14
sidecar
apiVersion: apps/v1
kind: Deployment
metadata:
name: mpos
labels:
apps: mpos
spec:
replicas: 1
selector:
matchLabels:
@dapseen
dapseen / fluentd.yaml
Created April 8, 2020 12:14
AWS fluentD, reduce logs to namespace
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentd
namespace: amazon-cloudwatch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fluentd-role
@dapseen
dapseen / kubernetes.sh
Created July 13, 2020 21:24
kubernetes single file CI/CD
apk add gettext #install gettext
echo $KUBE_TOKEN | base64 -d > ./kube_token
echo $KUBE_CA | base64 -d > ./kube_ca
kubectl config set-cluster $CLUSTER_NAME --server=$SERVER_URL --certificate-authority="$(pwd)/kube_ca"
kubectl config set-credentials $K8S_SA --token="$(cat ./kube_token)"
kubectl config set-context $K8S_SA --namespace=$NAMESPACE --cluster=$CLUSTER_NAME --user=$K8S_SA
kubectl config use-context $K8S_SA
#deploy image to AWS ECR
docker build -t ${BITBUCKET_REPO_OWNER}/${REPO_NAME} .
@dapseen
dapseen / instascraper.py
Last active August 22, 2021 21:55
Instascraper
from instascrape import *
#import instascrape
headers = {
"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.57",
"cookie":"sessionid=1573657342%3ACjfOyxQ2XdWAOx%3A0"
}
hashtag = Hashtag("https://www.instagram.com/explore/tags/abujarestaurant")
hashtag.scrape(headers=headers)