 Hello today, we're going to talk about posting your code privately on your surf posting it posting it privately We're gonna set up basically your own private pay spin on your own server Just a little bit ago. I was trying to help a friend with some code of his he wasn't here we're talking remotely and First he keeps sending me screenshots of the code and then he sends me the code in Google Docs I asked him why he was using Google Docs and Not some other You know place where you can post actual code rather than documents and his response was he was worried that AI was gonna steal his ideas The AI stealing everybody's code. I really don't care, but Still there's times. It's good to do things yourself. It's good to keep certain things private So we are going to use a program today a free and open-source program called private bin and Go show you the very minimals of how it works, but first we need a web server So I'm going to set up a web server here Oh, I'm also running off a flash drive right now So I want to make sure I was on a fresh system and that I was doing this as like a a new system I didn't already have dependencies installed So I'm working off MX Linux off a flash drive. So I have floating windows I'm not really used to so if I fumble around a little bit forgive me, but we're gonna pseudo apt update When that is done, then you'll type in your password. I just did this to install simple screen recorder But now that that is done. We're gonna pseudo apt install a patchy to and PHP There's the only two dependencies you need for the basic program It's gonna be something else we install after that But again, I highly recommend you read the documentation on their github page Because it goes into other things on detail plus this is going to encrypt and store things Encrypted locally, but you would still need to set up some certificates if you're going to be sharing this Across networks and you want it encrypted obviously. I'm not gonna get into that on this But sir pop just look it up simple to use. We're gonna get a patchy installed here now if we switch over to Firefox here and I go local host. You'll see that though the server is already installed and I am it's running Patchy to Let's go back to our terminal here And actually let's go back to our web browser. Here we go We are going to Google search or whatever search engine you want I think Google is gonna be the default in this setup here. We are going to search for private Paste been just pride private been is in the program private paste been get and one of your first one should be their GitHub page private been private been github. It's got four and a half thousand stars It's got 622 forks and it's been around for years. Let's go and it's open source I think there it's under a GPL license if you look at that But let's go ahead and click on the latest release scroll down and again look at their documentation Talking they're talking about different things you can do to secure this more But we're just going to download the source code zip Okay, we've got that downloaded Firefox. I believe put it in my downloads directory by default Let's go. Yeah to here and if we go into Var www HTML this is where our web servers root directory is and what I'm going to do is I'm going to sudo Unzip from my home directory my downloads directory that paste been file. It is unzipped Let's go ahead and just rename it because right now it's a private been Dash one dot five or whatever the version number is let's just call it private Been okay, so we're moving it to that got to do sudo and that is actually our next step We are going to change some permissions here because if we were to go to our web browser right now And again go to our local host whoops Local host this time we do forward slash private Been with the capital letters of course being important You'll see it's here But we try to do stuff and it's going to give you an error because it's unable to write to the files It needs to so what do we need to do? We'll go back to our terminal here and the first thing we need to do is change it so It is owned by the web user www-data for the user and group Private been at least is how I do it again read through the documentation They have lots of suggestions on making things more private and then we're also going to want to change this So we're going to sudo change mod dash our meaning recursively all the way through G plus RW that's just saying the groups and given the permissions for the groups for this directory and all the files below it Now if we go back to here and we say oh send Okay, it worked. I thought we might have to start restart Apache, but we didn't there we go So it pasted it and it gave you a URL which right away you can copy I can send it to somebody although I'm running a local host Obviously you're going to have your domain Especially if you're going to be working with security certificates, but you give someone that URL and they can view it now You'll see here. It says document will expire in six days Let's go ahead and create a new and you can see here by default it has a week Of course you can change your defaults You can say expires in five minutes ten minutes an hour a day a week a month a year or never You can do say it to burn so as soon as they open it they can read it But if once they try to refresh or go to that link again, it will no longer exist You can also set a password. Let's go ahead and again just type something and send and there it is Let's go new. I am going to change this to source code and I'm just gonna say bin bash and I'll say echo. Hello world Exit, you know just to have something in there I'll say send and since I said it was source code It shows it with line numbers and some color coding just kind of a generic because it you know could use multiple different languages in there I didn't select what language now again. We can Copy that URL you can click here. It gives you a QR code that you can scan But I can click on this link copy to send it somebody and again It shows it with line numbers, but just like other paste bin or paste Services out there you can just do raw text and you will have a link to the raw text that you can download So you don't have to worry about all that other HTML Let's go back to here. Let's go new and let me write This is my cool code and send that. Oh, I forgot to do what I wanted to do Let's try that again. We're gonna say this is my Cool code I can also click here and say open for discussion Send and now when someone goes to that URL they have an option to add comments And if we click here, I can say that my name is jerk and I can say you code Sucks and when I hit paste forgot to turn off my phone here I get an error and that's because there's one other dependency. We need to install for this to work So let's go back to our code here and we're gonna go pseudo apt install PHP dash GD And yes, we want to install that and If we go back to Firefox, let's say paste Didn't work. I think we need to restart Apache for this one. So pseudo Ford slash ETC and it's D Apache and re is it Apache to Restart or however you restart your services. I know there's different ways to do it depending on how your system set up and Now I can post my comments and they can see and then, you know, I can reply now. I can say Bob Me make Good code Anyway, so this is all being stored in that directory. You didn't have to set up any databases or anything I just don't know how much simpler it can get you install some dependencies Unzip this file and change some permissions and you're ready to go Now again, you're also if you're going to actually be doing this and you're worried about Privacy you're gonna have to set up some security keys for your web server. That's a whole nother You know issue there and again, this is for sharing Now will I be using this on my main films by chris? Dot com website. I thought about but no, it's it's not kind of useful for me right now Like I said, I'm using paste bin, which is not the best It's just what I'd be using forever and I have scripts on my server where you can search through all my paste bins And I automatically back all those up the thing about this is this is for privacy I want to share mine publicly. There's no list here of pastes You know, these are all designed to expire and be encrypted so no one can see them when I post code online I want everyone to see it. Um, so um, although I'd like to get away from paste bin and probably use something else I'm not going to be going to this but this is great If you are concerned about privacy and you are sharing things you want them to be private Unlike my code that I'm sharing with you guys publicly Uh, but yeah, that's pretty much it. I thank you for watching I'll put links to notes in the description of this video upon paste bin And uh, if you have any questions ask below but really look over the documentation At their website because they go into details on on again I showed you how to install and get it running They give you some pointers on configuring it different ways making sure that you know that it's definitely Not accessible to other users on your system if you have most uh multiple users on your system That sort of stuff, but everything is encrypted. So that's it. Thanks for watching Films by chris.com. That's chris of the k if you're one of my patrons on patreon Thank you so much. If not think about supporting link in the description patreon.com forward slash metal x 1000 Yep, that's it. There's a link in the description. You can all support me on my website Just think about liking sharing subscribing commenting. I thank you for watching and I hope that you have a great day