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 | |
arc=$(uname -a) | |
pcpu=$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l) | |
vcpu=$(grep "^processor" /proc/cpuinfo | wc -l) | |
fram=$(free -m | awk '$1 == "Mem:" {print $2}') | |
uram=$(free -m | awk '$1 == "Mem:" {print $3}') | |
pram=$(free | awk '$1 == "Mem:" {printf("%.2f"), $3/$2*100}') | |
fdisk=$(df -Bg | grep '^/dev/' | grep -v '/boot$' | awk '{ft += $2} END {print ft}') | |
udisk=$(df -Bm | grep '^/dev/' | grep -v '/boot$' | awk '{ut += $3} END {print ut}') | |
pdisk=$(df -Bm | grep '^/dev/' | grep -v '/boot$' | awk '{ut += $3} {ft+= $2} END {printf("%d"), ut/ft*100}') |
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 | |
wall $'#Architecture: ' `hostnamectl | grep "Operating System" | cut -d ' ' -f5- ` `awk -F':' '/^model name/ {print $2}' /proc/cpuinfo | uniq | sed -e 's/^[ \t]*//'` `arch` \ | |
'\n#CPU physical: '`cat /proc/cpuinfo | grep processor | wc -l` \ | |
'\n#vCPU: '`cat /proc/cpuinfo | grep processor | wc -l` \ | |
'\n'`free -m | awk 'NR==2{printf "#Memory Usage: %s/%sMB (%.2f%%)", $3,$2,$3*100/$2 }'` \ | |
'\n'`df -h | awk '$NF=="/"{printf "#Disk Usage: %d/%dGB (%s)", $3,$2,$5}'` \ | |
'\n'`top -bn1 | grep load | awk '{printf "#CPU Load: %.2f\n", $(NF-2)}'` \ | |
'\n#Last boot: ' `who -b | awk '{print $3" "$4" "$5}'` \ | |
'\n#LVM use: ' `lsblk |grep lvm | awk '{if ($1) {print "yes";exit;} else {print "no"} }'` \ | |
'\n#Connection TCP:' `netstat -an | grep ESTABLISHED | wc -l` \ |
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 { Dispatch, SetStateAction, useContext } from 'react' | |
import { ThemeContext } from '../context/Theme' | |
import { | |
DARK_THEME_BACKGROUND, | |
DARK_THEME_SECONDARY, | |
DARK_THEME_SECONDARY_VARIANT, | |
DARK_THEME_TEXT, | |
DARK_THEME_VARIANT, | |
DARK_THEME_BACKGROUND_VARIANT, |
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 React, { Dispatch, SetStateAction, useEffect, useState } from 'react' | |
import { useColorScheme } from 'react-native' | |
import { getItem, setItem } from '../lib/storage' | |
export type ThemeOptions = 'light' | 'dark' | |
export interface ThemeContextInterface { | |
theme: ThemeOptions | |
setTheme: Dispatch<SetStateAction<ThemeOptions>> | |
} |
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 AsyncStorage from '@react-native-async-storage/async-storage' | |
import { Platform } from 'react-native' | |
const os = Platform.OS | |
const webStorage = window.localStorage | |
const appStorage = AsyncStorage | |
const getItem = async (key: string) => { | |
if (key) { | |
return os === 'web' |
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
const BRAND_COLOR = '#57C69E' as const | |
const LIGHT_THEME_BACKGROUND = '#EEEEEE' as const | |
const LIGHT_THEME_TEXT = '#111111' as const | |
const LIGHT_THEME_VARIANT = '#333333' as const | |
const LIGHT_THEME_SECONDARY = '#777777' as const | |
const LIGHT_THEME_SECONDARY_VARIANT = '#BBBBBB' as const | |
const LIGHT_THEME_BACKGROUND_VARIANT = '#CCCCCC' as const | |
const DARK_THEME_BACKGROUND = '#111111' as const |
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
create type public.user_status as enum ('ONLINE', 'OFFLINE'); | |
create type public.message_type as enum ('TEXT', 'IMAGE', 'VIDEO'); | |
create table channels ( | |
id uuid default uuid_generate_v4() primary key | |
); | |
create table messages ( | |
id uuid default uuid_generate_v4() primary key, | |
content text not null, |
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 { useRouter } from 'next/router' | |
import React, { useEffect } from 'react' | |
import ReactMarkdown from 'react-markdown' | |
import PostNotFound from '../../components/errors/PostNotFound' | |
import DefaultWrapper from '../../components/layout/DefaultWrapper' | |
import Navigation from '../../components/modules/Navigation' | |
import { | |
useFindOneBySlugQuery, | |
useIncrementViewMutation, | |
} from '../../generated/graphql' |
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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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> | |
<div> | |
<form @submit.prevent="submit"> | |
<div v-for="(input, i) in inputs" :key="i"> | |
<label :for="input.name">{{ input.placeholder }}</label> | |
<input | |
:id="input.name" | |
:ref="input.name" | |
:type="input.type" | |
:placeholder="input.placeholder" |
NewerOlder