[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
What's in your MOTD, /g/ents?
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 62
Thread images: 5
File: motd_00.png (14 KB, 805x1001) Image search: [iqdb] [SauceNao] [Google]
motd_00.png
14 KB, 805x1001
What's in your MOTD, /g/ents?
No one ever sees mine so I decided to have some fun with it.
>>
Gay, delete thread please
>>
fortune | cowsay
>>
Shameless self-bump.
>>
>>52686405
Is this for your house or work?

do people do this when working for a company? I'd imagine only a select few people ever really see it. It's when you ssh into a router or switch right? Would it have to be configured on every single one on the network?
>>
>>52687478
It's a home server. MOTD is displayed as a login banner for SSH, yes.
>>
>>52687498
Cool, what's your server for?

Right now I've got my desktop working as a Plex server, but it fucks me over if I'm playing a game and it has to encode something, because I share my library with a lot of people, so I want to have a dedicated machine and just throw my hard drives in it and then maybe host other files from it and other shit, idk. Did you build the server or buy it prebuilt or was it just an old computer?
>>
>>52686405
Rate
from PIL import Image

#Opens the image, converts it to greyscale and saves it.
img = Image.open('batman.jpg')
img = img.convert('LA')
#Thanks Lee
img = img.rotate(90, expand=True)
img.save('greybatman.png')

'''The lower the value, the darker the average.
We use 'weightier' characters like @ for the dark colours,
and more soft characters like "*" for the lighter colours.'''
characters = {
0: '@',
10: '#',
20: 'N',
30: '$',
40: '8',
50: '&',
70: '£',
80: '^',
90: '*',
100: '.',
110: ' '
}


IMAGE_WIDTH, IMAGE_HEIGHT = img.size

STEP_WIDTH = 40
STEP_HEIGHT = 20

'''Gets the average of all pixel values within the step.
E.g, STEP_WIDTH = 10 and STEP_HEIGHT = 10. Adds up the values of all
100 pixels, divides it by 100 and returns the result. The average is used in
determining what character to use. The lower the value, the more bold the character.'''
def getAverage(x, y):
count = 0
for i in range(x - STEP_WIDTH, x):
for n in range(y - STEP_HEIGHT, y):
#Get the value of the pixel at every place within the step.
pixl = img.getpixel((i, n))
#getpixel returns a tuple, but we're only interested in the first element.
count += pixl[0]
#to find the average, add up all elements and divide by the number of elements.
#Count contains all of the values added up, now we divide them by the number of pixels in each step.
return count / (STEP_WIDTH * STEP_HEIGHT)

#Iterate over the whole image, taking steps defined earlier.
for x in range(STEP_WIDTH, IMAGE_WIDTH, STEP_WIDTH):
for y in range(STEP_HEIGHT, IMAGE_HEIGHT, STEP_HEIGHT):
#Get the average of all pixels within the last step.
average = getAverage(x, y)
'''This line is dense. Essentially, it searches the characters dictionary
for the value that's closest to the average we got previous, and prints the
corresponding character. We use end="" to avoids newlines.'''
print(characters[min(characters, key=lambda x:abs(x - average))], end="")
print("\n", end="")

>>
>>52687543
I bought a used rack server, it was cheap.

I use it for:
RADIUS AAA, backups, webhost, seedbox, DNS server, OpenVPN, Tor relay, and [email protected]
>>
File: feels.png (13 KB, 640x400) Image search: [iqdb] [SauceNao] [Google]
feels.png
13 KB, 640x400
I once did a nice motd on my home server, but then i realised i am the only one that will ever see it and i cried a little.

Perhaps i should enable password authentication for root? at least some chinese botnet will would see it.
>>
>>52687602
>Perhaps i should enable password authentication for root?
I hope you're joking, friend.
>>
>>52687612
B-but maybe thats qt asian waifu thats bruteforceing my root?
>>
>>52687626
Nope, just Chinese Ministry of State Security bots.
>>
>>52687544
- Comment less
- Use ascii dithered blocks
- List-comprehend that average calculation

6/10 would rewrite to one-liner
>>
============
<hostname>
============
>>
>>52687585
whats the purpose of your own DNS server?
>>
>>52687695
So I don't have to rely on my ISP or 3rd-party services as well as caching.
>>
#!/usr/bin/python
import random

num_terms = 5 # Number of terms
term_bounds = (1, 20) # (min, max)
operators = ['+', '-', '/', '*'] # Operators (no ^)

eq = [str(random.randint(*term_bounds))] # First number
for _ in range(num_terms):
# Append operator and term
eq = eq + [random.choice(operators), str(random.randint(*term_bounds))]

# equation = obscure color solution end color
print(' '.join(eq), '= ' + '\x1B[30;40m' + str(eval(' '.join(eq))) + '\x1B[0m')
>>
>>52686405
Would you mine sharing yours please ?
>>
File: vgkqez.png (13 KB, 539x314) Image search: [iqdb] [SauceNao] [Google]
vgkqez.png
13 KB, 539x314
Random Bowie lyrics.
the ascii Art I have on all my servers.
(yes this is front facing, no there's nothing for you there) http://get.atuis.moe
>>
>>52687766
autis* not atuis, I'm a retard.
http://get.autis.moe
>>
>>52687763
http://hastebin.com/raw/giveyoyota
>>
>>52686405
========================
= Welcome! =
========================
>>
>>52687854
Oops.
========================
= Welcome! =
========================
>>
>>52687815
Thanks :)
>>
>>52687585
>[email protected]
Good man, I should really do something similar
>>
a pony ;_;
>>
>>52688064
Would you like some credits?
I can spare 1M.
>>
>>52686405
http://hastebin.com/raw/ilasetoqon

It's part of a poem by Chilean author Vicente Huidobro.
>>
>>52688130
I've only met one Chilean in my life and he was a very honest and down-to-earth guy.
>>
This may sound obvious, but I don't know how to make a bash (zsh) motd…

Should I use "echo -e 'Hello world'" ?
>>
>>52688168
What distro?
Try /etc/motd or /etc/issue.net
>>
>>52688184
Thanks, with ressources on the net and the help of a friend I found how to do this.

30 minutes ago I just didn't know how to paste text in Vim, and it was needed to delete huge portions of text in visual mode.

The step-by-step way to do so was to copy the text, open /etc/motd with vim, cmd :set paste and then paste it, so I could just put cat /etc/motd in my .zshrc. I didn't think about it.

Thanks :)
>>
>>52688305
nano would have made it easier, than vim.
>>
>>52686405
\0
>>
>>52688871
Are you sarcastic ?

It would've taken much more time to erase everything everytime I failed to prompt it properly than it has taken to do a Qwant search.

I'm just not used to vim because I don't code besides bash and LaTeX.
>>
>>52689369
I'm pretty sure nano can cut lines just like vim. I normally use emacs, though.
>>
File: motd.jpg (309 KB, 1000x747) Image search: [iqdb] [SauceNao] [Google]
motd.jpg
309 KB, 1000x747
This is what I have on my gentoo installation, I can't be arsed to boot it up and send the file over so here's an old photo.
>>
>>52690551
Please post the source.
>>
>>52686405
Echo "possible dark times ahead, but for now the weather is sunny " on all company servers
>>
>>52687776
>http://get.autis.moe
Bookmarked.
>>
>No rice no life
Written in ASCII art.
That's from back when I posted in the ODT of /wg/ ad lot, never changed it.
>>
this may seem stupid but I have linux running on my laptop, anytime to make a MOTD pop up ever time I open a terminal?
>>
>>52688064
What is [email protected]? Google didn't find anything.
>>
>>52691168
http:[email protected]
>>
>>52686405
Can we get code for this please? Hail Mars
>>
>>52691283
It's already been posted. See
>>52687815

Please learn to read, Guardsman.
>>
>>52690627
I had to change the goddamn password on my old funtoo laptop for this, have at it.
http://hastebin.com/raw/ecugizoqew
>>
>>52686405
my domain name in ASCII serif (figlet)

>>52687478
obviously his house. work's motd is usually "We're watching you. No unauthorized use."

>>52687585
nice. do you offer shared hosting? not asking because i want an acct, just curious

dns: publicly accessible or just localhost?

ovpn: good call though I prefer ssh tunnelling for ease of use

tor: +1 my man

>>52687602
>i am the only one that will ever see it
that's why httpd only serves a page with my motd :^)

>>52687695
>>52687707
cryptographically secure domain/ip mappings, cache integrity, 0ms lookup with cache

>>52687766
you own that domain name

>>52690551
:) fun
>>
>>52691632
You're a cool person, Anon.
>>
>>52691761
No shared hosting, local DNS.
>>
>>52691133
Yes, just put a line at the very beginning of your .bash_profile or whatever shell config file you use that looks somewhat like this:
 echo "I can't google"
>>
File: e20.png (75 KB, 600x600) Image search: [iqdb] [SauceNao] [Google]
e20.png
75 KB, 600x600
>>52687478
yea, I mean its not hard to do, you just ssh into every switch you want a MOTD for and

S1:en
S1:conf t
S1:banner MOTD $INSERT YOUR STUPID FUCKING MOTD MESSAGE HERE$
S1: end
>>
>>52687478
motd's in the workplace are used as a legal backing in case they want to prosecute or fire someone, basically "the fucking terminal says right there that authorized use only, you violated that so we're firing you" type deal.
>>
>>52692059
A+ config anon
>>
>>52686405
could you pls share your motd?
>>
>>52691761
>you own that domain name
good job anon, what are you gonna do ?
Dox me ?
>>
>>52693283
It's already been posted, twice.
>>
>>52693314
no, because searching for "autis.moe" only shows losers
>>
>>52687544
This is python, right? Bitches at me when I try to run on 2.7.9
>>
>>52687656
I get that you can effectively work backwards with a finished python script to remake it to one line, but this is one of those times I don't think it's going to accomplish anything worthwhile.
>>
>>52687544
Decent for a self project, but I still ended up using GIMP instead.
Thread replies: 62
Thread images: 5
Thread DB ID: 476935



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.