Skip to content

Instantly share code, notes, and snippets.

View bebyx.zsh-theme
# bebyx.zsh-theme (classic bash improved)
local user_host="%{$fg_bold[green]%}%n@%m:%{$reset_color%}"
local path_p="%{$fg_bold[blue]%}%~%{$reset_color%}"
local cmd_sign="%{$reset_color%}%{$fg[magenta]%}$%{$reset_color%}"
PROMPT='${user_host}${path_p}${cmd_sign} '
View dejavu.c
#include <stdio.h>
#include <string.h>
char* check_uniqueness(const char *chars);
int main() {
char chars[100] = "";
char buffer[100] = "";
scanf("%s", chars);
View pig_latin.c
#include <stdio.h>
#include <string.h>
char* latinize(char *word);
int main() {
char sentence[100];
char *token, *word;
const char delimiter[2] = " ";
fgets(sentence, 100, stdin);
View jungle.c
#include <stdio.h>
#include <string.h>
char* define_animal(char *noise);
int main() {
// Lions say 'Grr', Tigers say 'Rawr', Snakes say 'Ssss', and Birds say 'Chirp'
char noise[50];
char *token, *tmp;
const char delimiter[2] = " ";
View fibonacci.c
#include <stdio.h>
int fibonacci(int num);
int main() {
int i;
printf("Enter number:\n");
int result = scanf("%d", &i);
if (result == 0) {
bebyx /
Last active Oct 1, 2020
A script to download sources for LFS
curl | grep -e "\.tar\..\{2,3\}\"" | sed 's/^\s*\"\(\(https\?\|ftp\).\+\.tar\.\S\{2,3\}\)\".*/\1/g' > dlinks
while read LINE; do
wget -nc "$LINE"
done < dlinks
rm ./dlinks
bebyx /
Last active Aug 24, 2020
Python script to create directories
#!/usr/bin/env python3
# Python script to create directories: python path dir_name number_of_dirs dir_mode(e.g. 700)
import os, sys
for i in range(int(sys.argv[3])):
os.mkdir(os.path.join(sys.argv[1], sys.argv[2] + str(i + 1)), int(sys.argv[4], 8))
except OSError:
inotifywait -m -e close_write "$DIR" | while read file; do
pkill java
sudo cp -R /home/bebyx/CI/eschool.jar /home/bebyx/eSchool/target/eschool.jar
sudo java -jar /home/bebyx/eSchool/target/eschool.jar --spring.config.location=file:///home/bebyx/eSchool/src/main/resources/ > /home/bebyx/eschool2.log &2>/home/bebyx/eschool2err.log &
bebyx / mvsc
Last active Jul 12, 2020
Simple shell script to remove screenshots from general Pictures folder to separate Pictures/Screenshots/ folder
View mvsc
set -e
[ ! -d "$DIRECTORY" ] && mkdir $DIRECTORY
ls ${DIRECTORY%\s\/}*.png >/dev/null 2>&1 && mv ${DIRECTORY%s/}*.png $DIRECTORY && echo "Screenshots successfully moved in a separate folder" || echo "No new screenshots"
bebyx / xsetloop
Last active Mar 12, 2020
Script for running date and other stuff in dwm status bar
View xsetloop
let loop=0
while true; do
if [[ $loop%300 -eq 0 ]]; then
let loop=0
xsetroot -name " $weather | $(date '+%b %d %a') | $(date '+%H:%M:%S') "
let loop=$loop+1