Skip to content

Instantly share code, notes, and snippets.

Stefan Lasiewski stefanlasiewski

  • LBNL (Lawrence Berkeley National Laboratory)
  • Berkeley, CA
Block or report user

Report or block stefanlasiewski

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 gist:edb1a11df5174b4d6ce34223cba10e43
[root@devdb ~]# yum list --quiet mysql-community-server mysql-community-client mysql-community-libs mysql-community-common mysql-community-libs-compat
Available Packages
mysql-community-client.x86_64 5.7.22-1.el6 mysql57-community
mysql-community-common.x86_64 5.7.22-1.el6 mysql57-community
mysql-community-libs.x86_64 5.7.22-1.el6 mysql57-community
mysql-community-libs-compat.x86_64 5.7.22-1.el6 mysql57-community
mysql-community-server.x86_64 5.7.22-1.el6 mysql57-community
[root@devdb ~]# yum --quiet downgrade mysql-community-libs-5.7.22-1.el6.x86_64 mysql-community-common-5.7.22-1.
el6.x86_64 mysql-community-client-5.7.22-1.el6.x86_64 mysql-community-libs-compat-5.7.22-1.el6.x86_64 mys
ql-community-server-5.7.22-1.el6.x86_64
@stefanlasiewski
stefanlasiewski / gist:1d71ee0ece9c65bd1365968c954422c0
Created May 22, 2018
Removing MySQL Server wants to remove postfix, cronie, redhat-lsb-core & more
View gist:1d71ee0ece9c65bd1365968c954422c0
[root@devdb ~]# yum remove mysql-commercial\*
Loaded plugins: fastestmirror, priorities, ps, security, versionlock
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-commercial-client.x86_64 0:5.7.22-1.1.el6 will be erased
---> Package mysql-commercial-common.x86_64 0:5.7.22-1.1.el6 will be erased
---> Package mysql-commercial-libs.x86_64 0:5.7.22-1.1.el6 will be erased
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-6.el6_5.x86_64
---> Package mysql-commercial-libs-compat.x86_64 0:5.7.22-1.1.el6 will be erased
View macports-selfupdate.sh
#!/usr/bin/env bash
#set -xv
# Update MacPorts base to latest released version using 'selfupdate'
# Then upgrade all outdated ports (upgrade outdated), and uninstall old version of each port (-u),
# following these guides:
# http://guide.macports.org/#using.common-tasks.updating
# http://guide.macports.org/#using.port.upgrade
View gist:456bdb5476ecce9cdfee67127c42d92b
# Tested from a Mac command-line
$ dig +noall +answer SFDPH.ORG
$ dig +noall +answer www.SFDPH.ORG
www.sfdph.org. 1638 IN CNAME evqf8.x.incapdns.net.
evqf8.x.incapdns.net. 29 IN A 199.83.131.153
$
@stefanlasiewski
stefanlasiewski / logging-test.bash
Last active Mar 6, 2018
Easy logging for any bash script
View logging-test.bash
#!/usr/bin/env bash
# A handy way to redirect script output to syslog
# Way more granular then adding a bunch of `/usr/bin/logger` stanzas
# Thanks to http://urbanautomaton.com/blog/2014/09/09/redirecting-bash-script-output-to-syslog/ &
# Eric at https://twitter.com/lindvall/status/509054237267853312
echo "writing to stdout, before the I/O redirection"
@stefanlasiewski
stefanlasiewski / gist:be6776296e07e709e9d978d36c3681c5
Last active Dec 8, 2016
Ubuntu is noisy due to dpkg messages: apt-get -qq update && apt-get -qq upgrade && apt-get -qq install build-essential
View gist:be6776296e07e709e9d978d36c3681c5
$ docker run -it ubuntu
root@14d8108342b9:/# cat /etc/issue
Ubuntu 16.04.1 LTS \n \l
root@14d8108342b9:/# apt-get -qq update && apt-get -qq upgrade && apt-get -qq install build-essential
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 7259 files and directories currently installed.)
Preparing to unpack .../libc6_2.23-0ubuntu5_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
View Apple Mac: Display, Enable, Disable SOCKS Proxy via the commandline
# List all network interfaces on my Mac
```
$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Display Ethernet
Thunderbolt Ethernet
Wi-Fi
Display FireWire
Bluetooth PAN
@stefanlasiewski
stefanlasiewski / checkIfRunning.sh
Last active Sep 18, 2015
This example script will check to make sure that an earlier instance isn't already running before executing again. Useful for cronjobs that run every 5 minutes, and you don't want a backlog of processes piling up because of a slowness issue
View checkIfRunning.sh
#!/bin/sh
# This example script will check to make sure that an earlier instance isn't already running before executing again.
# Useful for cronjobs that run every 5 minutes, and you don't want a backlog of processes piling up because of a slowness issue
# Borrowed from http://stackoverflow.com/questions/1440967/how-do-i-make-sure-my-bash-script-isnt-already-running
# Modified to work on FreeBSD as well as Linux
# Example usage:
#$ ./checkIfRunning.sh
#Sleeping for 600 seconds.
@stefanlasiewski
stefanlasiewski / gist:9c709251c5569c928f1b
Last active Aug 29, 2015
FPM on CentOS 6 fails with ruby-devel 1.8.6 (SCL repository is not activated)
View gist:9c709251c5569c928f1b
[root@buildhost ~]# yum install ruby-devel gcc --quiet -y
[root@buildhost ~]# gem install fpm
Building native extensions. This could take a while...
Successfully installed json-1.8.3
Successfully installed cabin-0.7.1
Successfully installed backports-3.6.4
Successfully installed arr-pm-0.0.10
Successfully installed childprocess-0.5.6
Successfully installed fpm-1.3.3
6 gems installed
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
You can’t perform that action at this time.