Skip to content

Instantly share code, notes, and snippets.

View philipp-r's full-sized avatar
🦤

philipp-r philipp-r

🦤
View GitHub Profile
@philipp-r
philipp-r / backup-ftp-files.sh
Created June 23, 2023 07:26
Mirror files from FTP server to local server (here to backup the Dokuwiki)
#!/bin/bash
HOST='ftp.example.com'
USER='username'
PASS='password'
REMOTEFOLDER='/var/www'
LOCALFOLDER='/home/backup/ftpcopy'
lftp -f "
open $HOST
user $USER $PASS
@philipp-r
philipp-r / backup-mysql-mega.sh
Last active June 23, 2023 07:22
Backup MySQL database with MEGAcmd https://github.com/meganz/MEGAcmd/
#!/bin/bash
DATE=`date +%Y-%m-%d-%H-%M`
# PATH
PATH=/bin:/usr/bin:/usr/local/bin
# mysql dump
mysqldump -u nextcloud_backup -pPASSWORD --databases nextcloud > mysql_$DATE.sql
wait
# zip
7z a -mhe=on -pPASSWORD mysql_$DATE.7z mysql_$DATE.sql
wait
.onion
.tk
.well-known
1link.in
1url.com
2big.at
2pl.us
2tu.us
2ya.com
3utilities.com
@philipp-r
philipp-r / backup-lftp.sh
Created November 15, 2022 09:41
Backup files from FTP with lftp to a local folder
#!/bin/bash
HOST='ftp.example.com'
USER='username'
PASS='password'
REMOTEFOLDER='/var/www'
LOCALFOLDER='/home/user/backup'
lftp -f "
open $HOST
user $USER $PASS
@philipp-r
philipp-r / backup-wget-ftp.sh
Created November 20, 2020 11:15
Backup files from FTP with wget
cd destination-direction
wget --mirror --continue --ftp-user=username --ftp-password=password --no-host-directories ftp://src/pathname/
@philipp-r
philipp-r / linktree.html
Created August 29, 2020 16:46
Simple template for landing page to link stuff from Instagram - as alternative to linktr.ee / taplink.at
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body class="bg-dark">
@philipp-r
philipp-r / dokuwiki-import.php
Created August 12, 2020 14:37
Import RSS feed / podcast feed / xml file in dokuwiki
<?php
$xml = simplexml_load_file("https://example.com/feed.xml");
foreach($xml->channel->item as $podcastItem){
// data:
$podcast_title = $podcastItem->title->__toString();
$podcast_id = $podcastItem->guid->__toString();
$podcast_link = $podcastItem->link->__toString();
// datum umwandeln:
@philipp-r
philipp-r / tweepy-bot.py
Created May 28, 2020 15:45
Twitter bot with tweepy (reply to tweets by search criteria)
import tweepy
import datetime
auth = tweepy.OAuthHandler("xxxxx", "xxxxxx")
auth.set_access_token("xxxx", "xxxxxxxxxx")
api = tweepy.API(auth)
@philipp-r
philipp-r / clamav_scanner.sh
Created May 26, 2020 17:12
ClamAV Scanner Script
#!/bin/bash
clamscan -i -r $1 > clamlog.txt 2>&1
clamstatus=$?
clamlog=$(<clamlog.txt)
#echo "$clamlog"
if [ $clamstatus == 2 ]; then
clamstatustext="ERROR"
@philipp-r
philipp-r / download-unzip.php
Last active October 20, 2023 13:32
Download and unzip file with PHP
<?php
// get latest german WordPress file
$ch = curl_init();
$source = "https://de.wordpress.org/latest-de_DE.zip";
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);