add postgres/masto post

This commit is contained in:
Amolith 2019-01-30 14:23:40 -05:00
parent 187e344192
commit 594b212784
Signed by: Amolith
GPG Key ID: 51FD40936DB0065B
4 changed files with 120 additions and 2 deletions

View File

@ -0,0 +1,23 @@
---
layout: post
title: Removing Masto usernames from PostgreSQL
subtitle: Give a Mastodonian their handle back
description: Give a Mastodonian their handle back
cover: /assets/posts/mastodon.png
date: 2019-01-30 13:16 -0500
---
The other day, I had a friend of mine create an account on [my Mastodon instance](https://masto.nixnet.xyz/). I made him an admin account thinking I'd have the _ability_ to demote him if I needed to only to find that I couldn't. So I had him delete his account thinking that he'd be able to remake it with the same username only to find that he couldn't. This is the username he uses everywhere (like me with Amolith) so I wanted to get it back for him. I did some digging and found that I would have to delete the handle from Masto's PostgreSQL database. I'd never used postgres before so it was very new; a rundown of the basic commands is below along with the one I used to delete his username at the end.
***NOTE:*** I don't know how this will affect your instance if the user had toots before they deleted their account. Handles federate from instance to instance and things could very well break if another instance had the user's information already. Thankfully, my friend was busy that day and hadn't even started configuring his account, much less tooted anything.
# PostgreSQL Syntax
`\l` - list databases
`\c <database>` - change databases
`\d` - list tables
`\d+ <table>` - list columns in the specified table
`select <column> from <table>;` - show the entries in the specified column
`delete from <table> where <column> = '<user_handle>';` - delete the username
The command sequence I used was:
`\c mastodon`
`delete from accounts where username='<handle>';`

BIN
assets/posts/mastodon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

93
assets/svgs/mastodon.svg Normal file
View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1000"
height="1000"
viewBox="0 0 264.58333 264.58334"
version="1.1"
id="svg8"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="mastodon.svg"
inkscape:export-filename="/home/amolith/repos/nixnet/assets/pages/mattermost.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2">
<symbol
id="shield-alt">
<title
id="shield-alt-title">Alternate Shield</title>
<path
style="stroke-width:0.26458332"
inkscape:connector-curvature="0"
d="m 131.23333,33.866667 c 0,58.547529 -35.965868,91.187323 -58.615524,100.623153 a 12.7,12.7 0 0 1 -9.76921,0 C 34.526802,122.69073 4.2333333,86.383019 4.2333333,33.866667 A 12.7,12.7 0 0 1 12.04886,22.143508 l 50.8,-21.16666633 a 12.7,12.7 0 0 1 9.769211,0 L 123.41807,22.143508 a 12.7,12.7 0 0 1 7.81526,11.723159 z m -63.499997,84.220313 0.01746,0.009 C 92.551515,105.74285 113.39063,76.739485 114.26904,36.676012 L 67.733333,17.286023 Z"
id="path26851" />
</symbol>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="288.30054"
inkscape:cy="498.99184"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:window-width="1336"
inkscape:window-height="698"
inkscape:window-x="15"
inkscape:window-y="35"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-32.41665)">
<rect
style="opacity:1;fill:#323232;fill-opacity:1;stroke:none;stroke-width:4.23333311;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect99612"
width="264.58334"
height="264.58334"
x="-5.0862632e-06"
y="32.416645" />
<path
inkscape:connector-curvature="0"
style="fill:#fdfdfd;fill-opacity:1;stroke-width:0.30233327"
d="m 195.45777,141.45186 c 0,-29.38679 -19.25863,-38.00329 -19.25863,-38.00329 -18.89583,-8.67696 -69.08316,-8.586266 -87.797601,0 0,0 -19.25863,8.6165 -19.25863,38.00329 0,34.97997 -1.9954,78.42526 31.926411,87.40456 12.24449,3.23496 22.76569,3.93033 31.23103,3.4466 15.35852,-0.84654 23.97502,-5.47223 23.97502,-5.47223 l -0.51397,-11.15611 c 0,0 -10.97469,3.4466 -23.30989,3.05358 -12.21427,-0.42327 -25.09366,-1.33027 -27.08906,-16.326 -0.1814,-1.33027 -0.2721,-2.721 -0.2721,-4.20243 25.87973,6.31876 47.95005,2.75123 54.02696,2.02563 16.96089,-2.02563 31.74499,-12.48637 33.61946,-22.0401 2.96286,-15.0562 2.721,-36.7335 2.721,-36.7335 z m -22.70523,37.85213 H 158.6638 v -34.52646 c 0,-15.02596 -19.34932,-15.6004 -19.34932,2.0861 v 18.89583 h -13.99804 v -18.89583 c 0,-17.6865 -19.34932,-17.11206 -19.34932,-2.0861 v 34.52646 H 91.848139 c 0,-36.91489 -1.57214,-44.71509 5.56294,-52.90833 7.830441,-8.73743 24.126201,-9.31185 31.382201,1.84424 l 3.50707,5.8955 3.50706,-5.8955 c 7.28623,-11.21656 23.61223,-10.5212 31.38219,-1.84424 7.16531,8.25371 5.56294,16.02367 5.56294,52.90833 z"
id="path2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -1,7 +1,7 @@
---
layout: page
title: Friends
subtitle: Friends of NixNet
title: Friends of NixNet
subtitle: A list of some like-minded people and their websites
description: A list of some like-minded people and their websites
cover: /assets/pages/friends.png
permalink: /friends/
@ -9,7 +9,9 @@ permalink: /friends/
## People
* [Elias Ojala](https://lelux.fi/) - really cool guy who hosts some services like I do
* [Anxhelo Lushka](https://lushka.al/) - graphic designer, frontend developer, computer engineering student and heavy open source user/advocate. Has an interesting blog.
* [Luke Smith](http://lukesmith.xyz/) - makes technology videos on YouTube, is the Luke of [Luke's Auto-Rice Bootstrapping Scripts (LARBS)](https://larbs.xyz/), and does a podcast called _Not Related_ on "Big-Braned" topics
## Organisations
* [LibreHo.st](https://libreho.st/) - a network of average people who host FLOSS services available for anyone to use
* [Snopyta.org](https://snopyta.org/) - Snopyta provides online services based on freedom, privacy and decentralization. Part of LibreHosters
* [CYGONetwork.com](https://cygonetwork.com) - alternative to Facebook. Better features, better community, and enhanced privacy/security