Skip to content

Instantly share code, notes, and snippets.

@bvaudour
bvaudour / kcp.sh
Last active August 29, 2015 14:01
Bash script to get and build an app from KCP
#!/bin/bash
prefix="https://github.com/KaOS-Community-Packages/"
gitapi='Accept: application/vnd.github.v3.text-match+json'
if [ $# -eq 1 ]; then
name=$1
args=""
else
name=${@:$#}
args=${@:1:$#-1}
@bvaudour
bvaudour / kcp.py
Last active August 29, 2015 14:01
KCP manager in cli - POC
#!/usr/bin/env python3
# License: Public Domain
# Release: dev
import argparse, os, sys, subprocess, json
from urllib import request
search_head = 'application/vnd.github.v3.text-match+json'
search_h_tp = 'Accept'
search_base = 'https://api.github.com/search/repositories?q={}+user:KaOS-Community-Packages'
@bvaudour
bvaudour / ua.sh
Last active August 29, 2015 14:01
UserAdd
#!/usr/bin/env bash
user=$1
pass=$2
sudo useradd -m \
-g users \
-s /bin/bash
-G network,video,audio,storage,scanner,power,lp \
-u 1001 \
-p ${pass} \
${user}
@bvaudour
bvaudour / PKGBUILD
Created June 11, 2014 15:44
Example of PKGBUILD with pip
pkgname=frescobaldi
pkgver=2.0.16
pkgrel=1
pkgdesc="A LilyPond sheet music editor for KDE4. It aims to be powerful, yet lightweight and easy to use."
arch=('x86_64')
url="http://www.frescobaldi.org/"
license=("GPL")
depends=('lilypond' 'python2-pip' 'pyqt' 'poppler-qt')
_pythondep='python-poppler-qt4'
optdepends=('lilypond-doc')
@bvaudour
bvaudour / PKGBUILD
Created June 11, 2014 15:56
Otter PKGBUILD
#Maintainer:
_pkgname=otter
pkgname=${_pkgname}-browser-git
pkgver=0.9.01.r14
pkgrel=1
pkgdesc='Otter Browser, project aiming to recreate classic Opera (12.x) using Qt5.'
arch=('x86_64')
url="http://www.otter-browser.org"
license=('Unknown')
@bvaudour
bvaudour / job_11.py
Created July 6, 2014 18:22
Example of bash conversion to python
def msg(self, mesg):
print(':: BACKEND {}'.format(mesg))
return
def msg_job_start(self, mesg):
print(' ')
print(' ')
print('>> STARTING JOB {}'.format(mesg))
return
@bvaudour
bvaudour / job_2.py
Last active August 29, 2015 14:03
Job 2 with corrections
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# job_configure-users
#
# Copyright 2014 KaOS (http://kaosx.us)
#
# 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
@bvaudour
bvaudour / helpers.py
Created July 8, 2014 18:39
Helpers for thus jobs
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def msg(mesg):
print(':: BACKEND {}'.format(mesg))
return
def msg_job_start(mesg):
print(' ')
print(' ')
@bvaudour
bvaudour / job_5.py
Last active August 29, 2015 14:04
Complete...
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# job_cleanup_drivers
#
# Copyright 2014 KaOS (http://kaosx.us)
#
# 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
==> Création du paquet kcp 0.12-1 (ven. juil. 25 20:38:16 CEST 2014)
==> Vérification des dépendances pour l’exécution...
==> Vérification des dépendances pour la compilation...
==> Récupération des sources...
-> Téléchargement de kcp-0.12.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 127 100 127 0 0 234 0 --:--:-- --:--:-- --:--:-- 234
0 0 0 9142 0 0 8645 0 --:--:-- 0:00:01 --:--:-- 8645
==> Validation des fichiers sources avec md5sums...