Skip to content

Instantly share code, notes, and snippets.

ainsofs /
Last active Feb 10, 2021
mount / unmount volumes in linux
# list volumes
sudo fdisk -l
# create a mount location
mkdir -p /mnt/some-vol
# mount
mount /dev/xvdf /mnt/some-vol
# unmount
ainsofs / add_https.bat
Last active Nov 24, 2020
Use this snippet to add https to an IIS7 site
View add_https.bat
appcmd set site /"<IISSiteName>" /+bindings.[protocol='https',bindingInformation='*:443:<hostHeaderValue>']
ainsofs / template.yml
Created Sep 16, 2020
custom wodby stack - IPT
View template.yml
type: drupal8
infrastructure: ^5.1
enabled: true
required: true
image: 'gbif/ipt:2.4.2'
- 'edge::80:8080/tcp'
ainsofs / drupal console commands.txt
Created Aug 24, 2020
export content type using drupal console
View drupal console commands.txt
# export content type using drupal console
drupal config:export:content:type page \
--module="demo" \
--optional-config \
--remove-uuid \
View drush commands
# remove missing module
drush sql-query "DELETE FROM key_value WHERE collection='system.schema' AND name='module_name';"
# how to re-apply drupal update
drush ev "drupal_set_installed_schema_version('field_group', 8000)"
# delete live configs
ainsofs / web.config
Last active Mar 18, 2020
web.config redirect http to https
View web.config
<!-- requires url rewrite module --->
<!-- -->
<rule name="Redirect http to https" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<add input="{HTTPS}" pattern="off" />
View mssql_commands
-- kill all connections For MS SQL Server 2000, 2005, 2008
USE master;
DECLARE @kill varchar(8000); SET @kill = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), spid) + ';'
FROM master..sysprocesses
WHERE dbid = db_id('MyDB')
ainsofs / reindex_alfresco_solr
Created Oct 17, 2019
reindex alfresco solr
View reindex_alfresco_solr
For Alfresco 4.x and Solr 1.4:
#! /bin/bash
export ALF_HOME=/opt/alfresco4
export SOLR_HOME=/opt/alfresco4/alf_data/solr
$ALF_HOME/ stop
sleep 10
rm -rf $SOLR_HOME/workspace/SpacesStore/*
View postgres_commands
## login to a database
psql -U [username] [database_name]
## check database size
SELECT pg_size_pretty( pg_database_size('dbname') );
## check table sizes (top 5)
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
ainsofs / update_drupal_commands
Last active May 4, 2020
Command lines to update Drupal
View update_drupal_commands
# ensure you have backed up the database and files before running these commands
# mysql/mariadb
drush sql-dump --gipz --result-file
pg_dump -U postgres -h localhost "[YOUR_DATABASE]" | gzip > [dbname]-[date]00.sql.gz
# remove old files
rm -rf images/ includes/ misc/ modules/ profiles/ scripts/ themes/
rm -f .* *.php *.txt *.config