Skip to content

Instantly share code, notes, and snippets.

@ZamanOof
ZamanOof / check connection.py
Created March 3, 2022 20:28
to check connection
# check internet connection
# @hostname str domain name
# todo initial function
#startup
def is_connected(hostname='w.wiki'):
logger.info(f'"trying to check connection"')
while True:
try:
# see if we can resolve the host name -- tells us if there is
# a DNS listening
@ZamanOof
ZamanOof / update time by script alternative ntp,timedatectl.md
Created October 27, 2021 15:24
update your system using alternative ways

update date and time using http protocol

using curl to update date and time

sudo date -s "$(curl -H'Cache-Control:no-cache' -sI google.com | grep '^Date:' | cut -d' ' -f3-6)Z"

using wget to update date and time of linux/server

sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"

using htpdate

@ZamanOof
ZamanOof / backupxfs.py
Created October 21, 2021 06:10 — forked from decko/backupxfs.py
My oldest python script...
#! /usr/bin/python
# -*- coding: utf-8 -*-
##############################################################
# Programa para Backup de Partições XFS.
# André Filipe de Assuncao e Brito (decko@noisemakers.org)
# Fabricio Coutinho Medeiros (fabriciocoutinho@terra.com.br)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@ZamanOof
ZamanOof / aptly debian buster.md
Last active October 10, 2021 06:07
aptly buster

parametrs

need to choose

   --config for file .conf location if defualt just remove it
   -architectures= choose what u target for me for now x64
   -with-udebs debian udebs activated 
   -with-source for include source

notes

  • spread componets each other