Skip to content

Instantly share code, notes, and snippets.

View Yoda-BZH's full-sized avatar

Yoda-BZH Yoda-BZH

View GitHub Profile
@Yoda-BZH
Yoda-BZH / gist:c23a3d4e202ae97092a61d389af1bcf5
Created May 28, 2024 07:57
gitlab enhanced expired_tokens.rb
# this is an enhanced version of https://docs.gitlab.com/ee/security/token_overview.html?tab=Rails+console+session#expired_tokensrb
expires_at_date = "2024-05-22"
PersonalAccessToken.project_access_token.where(expires_at: expires_at_date).find_each do |token|
token.user.members.each do |member|
type = member.is_a?(GroupMember) ? 'Group' : 'Project'
if type == "Project"
p = Project.find(member.source_id)
@Yoda-BZH
Yoda-BZH / apache-balancer.sh
Last active June 21, 2018 08:24 — forked from SeonghoonKim/apache-balancer.sh
Apache HTTPD balancer-manager control script
#!/bin/sh
# Author: SeonghoonKim https://gist.github.com/SeonghoonKim/5385982
# Author: Yoda-BZH https://gist.github.com/Yoda-BZH/05a7b33df1740882a8e39e0b38de682d
# Set up a default search path
PATH="/usr/bin:/bin"
CURL=`which curl`
if [ -z "$CURL" ]
then
<VirtualHost 1.1.1.1:80>
ServerName example.com
RewriteEngine on
RewriteRule ^(.*) http://www.example.com [QSA,L,R=301]
CustomLog /home/www/example.com/log/apache/domaine-redirect.access.log combined env=!no_log
ErrorLog /home/www/example.com/log/apache/domaine-redirect.error.log
</VirtualHost>
<VirtualHost 1.1.1.1:80>
ServerAlias www.example.com