Skip to content

Instantly share code, notes, and snippets.

View Clivern's full-sized avatar

Ahmed Clivern

View GitHub Profile

Edit /etc/rc.local

python /root/program.py &
DISPLAY=:1 chromium-browser --kiosk http://127.0.0.0.1:8000
python /root/program.py &
DISPLAY=:1 chromium-browser --kiosk https://clivern.com
@Clivern
Clivern / app.md
Last active April 18, 2022 13:35
Learning NodeJs

HTTP Web Server

const server = require('http')
const SERVER_PORT = process.argv[2]  || 8000

server.createServer(function (req, res) {
    res.writeHead(200, {'content-type': 'text/plain'});
    res.end("Hello, World\n");
}).listen(SERVER_PORT);
@Clivern
Clivern / install.sh
Last active January 30, 2022 20:08
Install Cassandra on Ubuntu 20.04
#!/bin/bash
sudo apt update
sudo apt upgrade -y
sudo apt install openjdk-8-jdk apt-transport-https -y
java -version
sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 40x main" > /etc/apt/sources.list.d/cassandra.list'
wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt update
sudo apt install Cassandra
@Clivern
Clivern / Pindo.md
Last active December 11, 2021 23:02

Setup Docker

$ apt-get update
$ apt-get install docker.io -y
$ systemctl enable docker

Python

@Clivern
Clivern / single_linked_list.py
Created November 21, 2021 20:29
Single Linked List
class Node:
def __init__(self, data=None, next=None):
self.data = data
self.next = next
def __repr__(self):
return repr(self.data)
Python 3.9.7 (default, Oct 12 2021, 22:38:23)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> x = [1, 2, 3, 4, 5]
>>> x.append(6)
>>> x
[1, 2, 3, 4, 5, 6]
>>> x.index(6)
5
@Clivern
Clivern / Dockerfile
Created November 2, 2021 19:43
Run a Python Script with Docker Container
FROM python:3.9.7
MAINTAINER Clivern
RUN mkdir -p /etc/muffin
VOLUME /etc/muffin
CMD ["python"]
@Clivern
Clivern / RAILS_CHEATSHEET.md
Created October 23, 2021 10:40 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@Clivern
Clivern / jq-cheetsheet.md
Created October 20, 2021 09:48 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@Clivern
Clivern / github_emoji.md
Created September 8, 2021 17:14
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: