Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 99ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
l

linux

Recently created Least recently created Recently updated Least recently updated
anthony

anthony / Check OS in bash

Last active 1 month ago bash linux macos shell windows

Handy bash-functions to detect current OS

0 0 1
1 #!/usr/bin/env bash
2
3 isMac() {
4 uname -s | grep -q "Darwin"
5 }
6
7 isLinux() {
8 uname -s | grep -q "Linux"
9 }
anthony

anthony / Шаблон Makefile

Last active 1 month ago linux make makefile shell

Пример для использования в проектах

0 0 1
1 .DEFAULT_GOAL := help
2 .PHONY: goal1 goal2 help
3
4 ######################
5
6 ## goal1: Some goal 1
7 goal1:
8 @echo "This is goal 1"
9
10 ## goal1: Some goal 2
anthony

anthony / Как читать права файлов

Last active 1 month ago linux
0 0 1
flag  user  group  other
#     rwx    rwx    rwx
- Отсутствие флага (файл)
l Символическая ссылка (symbolic link)
d Директория (directory)
b Блочное устройство (block device)
c Символьное устройство (character device)