This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if tmux a -t default_session | |
then | |
echo Session connected and exitied gracefully | |
else | |
tmux new-session -s 'default_session' -d 'bpytop' | |
tmux rename-window 'System' | |
tmux new-window -d 'mc' | |
tmux select-window -t :=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os | |
for line in os.popen('ipconfig.exe'): | |
if not line[0] in [' ', '\n']: | |
current_section = line | |
active = False | |
if 'Link-local IPv6 Address' in line: | |
active = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Mutating An Array During .forEach() Iteration In JavaScript | |
</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T> | |
std::vector<T> readFile(const char *filename) | |
{ | |
std::vector<T> results; | |
std::ifstream fin(filename, std::ios::binary); | |
T n; | |
while (fin.read(reinterpret_cast<char *>(&n), sizeof(T))) | |
results.push_back(n); | |
return results; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# loop checking for a file, if the file exists exit | |
for (( ; ; )) | |
do | |
if [ -f ~/aah.txt ]; then | |
#echo "File Found!" | |
exit | |
fi | |
sleep 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.misc | |
import png | |
#import pil | |
import matplotlib.image as mpimg | |
def write_pgm(image, filename): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sense_hat import SenseHat | |
sense = SenseHat() | |
r = (255, 0, 0) | |
o = (255, 127, 0) | |
y = (255, 255, 0) | |
g = (0, 255, 0) | |
b = (0, 0, 255) | |
i = (75, 0, 130) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/bash | |
gcc producer.c -o producer | |
mknod myfifo.txt p | |
python consumer.py <myfifo.txt & | |
./producer | |
rm myfifo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
int main(int argc,char*argv) | |
{ | |
FILE *fp; | |
int i; | |
fp=fopen("myfifo.txt","w"); |
NewerOlder