Skip to content

Instantly share code, notes, and snippets.

View philipp-r's full-sized avatar
🦤

philipp-r philipp-r

🦤
View GitHub Profile
#!/bin/bash
apt-get update
apt-get -yt $(lsb_release -cs)-security dist-upgrade
apt-get --trivial-only dist-upgrade
apt-get autoclean
@philipp-r
philipp-r / itunes-api.php
Last active July 25, 2016 16:50
iTunes Search API
<?php
// Wonach wird gesucht?
$searchQuery = "284910350";
// iTunes API Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://itunes.apple.com/de/lookup?id=".$searchQuery);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$apiRequest = curl_exec($ch);
@philipp-r
philipp-r / pokemon-go-map-start.sh
Last active July 25, 2016 16:49
Start Pokemon GO Map (https://github.com/AHAAAAAAA/PokemonGo-Map) with multiple instances
#!/bin/bash
# Start Pokemon GO Map with multiple instances to scan
# see https://github.com/AHAAAAAAA/PokemonGo-Map/issues/1159#issuecomment-234522134
# Delete db when restarting
rm pogom.db
# Delete nohup.out
rm nohup.out
# Location 1
@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);
@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 / 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 / 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 / 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 / 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 / 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