Skip to content

Instantly share code, notes, and snippets.

Schlomo Schapiro schlomo

Block or report user

Report or block schlomo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View config_for_repo
APT::FTPArchive::Release::Origin "Schlomo";
APT::FTPArchive::Release::Label "Schlomo Stable";
APT::FTPArchive::Release::Architectures "amd64 armhf armel i386";
APT::FTPArchive::Release::Description "Private Packages";
View putinrepo.sh
#!/bin/bash
#
# Trivial DEB repo management
#
# Written by Schlomo Schapiro
# Licensed under the GNU General Public License, see http://www.gnu.org/licenses/gpl.html for full text
set -e -E -u
if [[ ! "${REPO_BASE_DIR:-}" ]] ; then
ME_DIR="$(dirname "$(readlink -f "$0")")"
for CHECK_DIR in "$ME_DIR" "$ME_DIR"/../repo "$ME_DIR"/repo ; do
@schlomo
schlomo / auto.sh
Created Feb 7, 2015
Ubuntu guest session configuration. This script runs as the guest user and should be installed as /etc/guest-session/auto.sh
View auto.sh
gsettings set org.gnome.desktop.lockdown disable-user-switching true
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set com.canonical.indicator.session suppress-restart-menuitem true
gsettings set com.canonical.indicator.session suppress-shutdown-menuitem true
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Alt>Shift_L']"
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'de+deadgraveacute'), ('xkb', 'il')]"
gsettings set com.canonical.indicator.datetime show-day true
gsettings set com.canonical.indicator.datetime show-seconds true
gsettings set com.canonical.indicator.datetime show-date true
gsettings set com.canonical.indicator.datetime show-week-numbers true
@schlomo
schlomo / prefs.sh
Created Feb 7, 2015
Ubuntu guest session customization. Install as /etc/guest-session/prefs.sh
View prefs.sh
touch "$HOME"/.skip-guest-warning-dialog
if [[ -r /usr/share/applications/google-chrome.desktop ]] ; then
mkdir -p "$HOME"/.local/share/applications
sed -e '/Exec/s/google[a-z-]\+/& --password-store=basic/' -e '/^Name=/s/=/&Guest /' \
< /usr/share/applications/google-chrome.desktop > "$HOME"/.local/share/applications/google-chrome.desktop
fi
mkdir -p "$HOME"/.config/autostart
for service in blueman.desktop deja-dup-monitor.desktop indicator-bluetooth.desktop indicator-power.desktop light-locker.desktop vino-server.desktop nm-applet.desktop ; do
if [[ -e /etc/xdg/autostart/$service ]] ; then
@schlomo
schlomo / disable-suspend-and-hibernate.pkla
Created Feb 7, 2015
PolicyKit Local Authority policy to disable suspend and hibernate for all users. Should be installed into /var/lib/polkit-1/localauthority/90-mandatory.d or /etc/polkit-1/localauthority/90-mandatory.d
View disable-suspend-and-hibernate.pkla
[Completely disable suspend and hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend;org.freedesktop.upower.hibernate;org.freedesktop.login1.suspend*;org.freedesktop.login1.hibernate*
ResultAny=no
ResultInactive=no
ResultActive=no
@schlomo
schlomo / guest-lockdown.pkla
Created Feb 7, 2015
PolicyKit Local Authority policy to lockdown Ubuntu guest session from modifying the system. Should be installed into /var/lib/polkit-1/localauthority/90-mandatory.d or /etc/polkit-1/localauthority/90-mandatory.d
View guest-lockdown.pkla
[Allow harmless stuff]
Identity=unix-user:guest-*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;com.canonical.indicator.sound.AccountsService.ModifyOwnUser;org.freedesktop.accounts.change-own-user-data
ResultActive=yes
[Allow handling removable media]
Identity=unix-user:guest-*
Action=org.freedesktop.udisks2.filesystem-mount;org.freedesktop.udisks2.eject-media;org.freedesktop.udisks2.ata-standby;org.freedesktop.udisks2.power-off-drive;org.freedesktop.udisks2.modify-device;org.freedesktop.udisks2.cancel-job;org.freedesktop.udisks2.rescan;org.freedesktop.udisks2.encrypted-unlock;org.freedesktop.udisks2.encrypted-change-passphrase
ResultActive=yes
@schlomo
schlomo / secure-umask.sh
Created Feb 7, 2015
Set umask to prevent world readable access
@schlomo
schlomo / -glmark2 benchmarks.txt
Last active Aug 29, 2015
Some glmark2 benchmarks on my new computer
View -glmark2 benchmarks.txt
CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
Kernel: 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
OS: Ubuntu 15.04 vivid (Beta) from December/January 2015
(NVidia GT610 tested on Ubuntu 14.10 utopic on same hardware)
@schlomo
schlomo / aws_mfa.sh
Created Sep 18, 2014
Helper Bash function to set up temporary AWS credentials for MFA protected accounts.
View aws_mfa.sh
function aws_mfa {
if [[ -z "$AWS_ACCESS_KEY_ID" ]] ; then
echo "Please set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY"
return 1
fi
if [[ -z "$REAL_AWS_ACCESS_KEY_ID" ]] ; then
REAL_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
REAL_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
fi
@schlomo
schlomo / amazon-id.conf
Created Sep 10, 2014
Amazon ID plugin for YUM. This will add 2 headers to the HTTP requests. With these headers the YUM repo server can identify the EC2 instance. These files come from the rh-amazon-rhui-client RPM package found on RHEL EC2 instances, probably part of the Red Hat Update Infrastructure (https://access.redhat.com/products/red-hat-update-infrastructure/)…
View amazon-id.conf
[main]
enabled=1
You can’t perform that action at this time.