Skip to content

Instantly share code, notes, and snippets.

View deep5050's full-sized avatar
💻
EMBEDDED SYSTEM

Dipankar Pal deep5050

💻
EMBEDDED SYSTEM
View GitHub Profile
@hikiko4ern
hikiko4ern / .bash_aliases
Last active October 29, 2023 20:24
Pikachu test passed (demo: https://asciinema.org/a/236096)
# /------------------------------------------\
# | don't forget to download the .tp file |
# | and place it in the user's directory :› |
# | |
# | also install lolcat: |
# | https://github.com/busyloop/lolcat |
# \------------------------------------------/
alias test-passed='if [ "$?" -eq "0" ]; then lolcat ~/.tp -a -s 40 -d 2; fi;'
@garcia556
garcia556 / get.c
Created December 3, 2017 21:08
POSIX shared memory IPC example (shm_open, mmap), working on Linux and macOS
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#define STORAGE_ID "/SHM_TEST"
#define STORAGE_SIZE 32
int main(int argc, char *argv[])
@josantonius
josantonius / language-codes.json
Last active July 8, 2024 20:34
List of 217 language codes (ISO 639-1)
{
"aa": "Afar",
"ab": "Abkhazian",
"ae": "Avestan",
"af": "Afrikaans",
"ak": "Akan",
"am": "Amharic",
"an": "Aragonese",
"ar-ae": "Arabic (U.A.E.)",
"ar-bh": "Arabic (Bahrain)",
@lool
lool / build-onie.sh
Last active October 9, 2023 07:50
Build ONIE VM image
#!/bin/sh
set -e
PACKAGES="git qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager git realpath autoconf bison flex texinfo libtool libtool-bin libncurses5-dev gawk gperf stgit build-essential fakeroot libexpat1-dev python-dev xorriso mtools dosfstools"
ONIE_URL="https://github.com/opencomputeproject/onie.git"
# needed to locate mkdosfs
export PATH=$PATH:/sbin:/usr/sbin
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@arubacao
arubacao / latlong.php
Last active February 10, 2024 00:55
Latitude Longitude Regular Expression Validation PHP
<?php
/**
* Validates a given latitude $lat
*
* @param float|int|string $lat Latitude
* @return bool `true` if $lat is valid, `false` if not
*/
function validateLatitude($lat) {
return preg_match('/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/', $lat);
@toonetown
toonetown / ssh_expect
Last active May 20, 2021 11:58
An expect script that will spawn ssh and automatically enter the password
#!/usr/bin/expect
#
# A script to handle automatic entering of ssh passwords. It is intended that this script
# mainly be used from within a docker image in conjunction with docker_pipe to avoid
# placing private keys and passwords in your image.
#
# This script can be used as a drop-in replacement for ssh, as all parameters are passed
# to the ssh command.
#
# To use (reading the password from the command line):
@bsweger
bsweger / markdown-table-to-html.py
Last active April 25, 2021 04:23
Convert markdown table rows to html (we converted some markdown tables to html so we could use the "scope" attribute in the header rows for accessibility).
#tabedata.txt is a file that contains the piped markdown table rows
with open ('markdownrows.txt') as f:
content = f.readlines()
rows = []
for c in content:
cells = c.split('|')
cells = ['<td>{}</td>'.format(cell.strip()) for cell in cells]
rows.append(cells)
@shubhamjain
shubhamjain / IndianStates.json
Last active November 17, 2023 05:11
Indian States and Union Territories in JSON format
{
"AN":"Andaman and Nicobar Islands",
"AP":"Andhra Pradesh",
"AR":"Arunachal Pradesh",
"AS":"Assam",
"BR":"Bihar",
"CG":"Chandigarh",
"CH":"Chhattisgarh",
"DN":"Dadra and Nagar Haveli",
@rxaviers
rxaviers / gist:7360908
Last active July 20, 2024 10:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: