@Pete-S said in Looking at Atom and VS Code:
JetBrains IDEs looks good but are not open source.
PyCharm and IntelliJ IDEA are
@Pete-S said in Looking at Atom and VS Code:
JetBrains IDEs looks good but are not open source.
PyCharm and IntelliJ IDEA are
@Obsolesce said in Looking at Atom and VS Code:
@stacksofplates said in Looking at Atom and VS Code:
@Pete-S said in Looking at Atom and VS Code:
@stacksofplates said in Looking at Atom and VS Code:
As for ctrl+<-/-> just modify the keybindings. Here's an answer for that specific command.
Great thanks. Too bad it's not just a simple setting.
Having the settings in JSON like that is nice because it's easy to back up. There's an extension that syncas all of your extensions and settings to a gist in GitHub.
I still use VSCode a good bit but most of my stuff is done in JetBrains tools now.
Sync is built in to VSCode for a bit now.
I haven't used it for a bit since I started using GoLand.
@Obsolesce said in Looking at Atom and VS Code:
I've never come across a need for virtual space. If I don't have anything written on a line, I wouldn't need a line comment there?
I just tried it in GoLand and I don't like it. If I'm going to a line it's usually so I can edit that line. It's uncomfortable to not jump to the actual data on the line.
snaps back to the correct place in Vim mode :man_shrugging:
@Pete-S said in Looking at Atom and VS Code:
@stacksofplates said in Looking at Atom and VS Code:
Saying they aren't versatile because of that one feature seems a little disingenuous. I'm sure if it was a simple thing to add or more people wanted it, it would be there.
I don't think it's disingenuous at all, not if the primary purpose is an editor for developers.
You'd expect a good deal of customization for something like that. That is what versatility is.It's really a common basic feature. Just to name a few - VS has it, vim has it, JetBrain have it, Notepad++ has it, CodeLite has it etc. If people didn't ask for it, nobody would have it.
But for sure, VS Code and Atom may be versatile in other areas - besides the actual code editing.
Yes it's still disengenuous. I know quite a few people that use VSCode as their full time IDE/editor and this is literally the first time I've heard this complaint.
Yes versatile in other areas like having a functioning debugger, live share, containerizing the whole dev environment, really decent git integration, decent built in terminal, etc. All things developers care about.
The tools still have more than "a good deal of customization".
This is like saying a mercedes isn't a good car because it doesn't have a heated steering wheel.
Saying they aren't versatile because of that one feature seems a little disingenuous. I'm sure if it was a simple thing to add or more people wanted it, it would be there.
@Pete-S said in Looking at Atom and VS Code:
It sure seems like VS Code and Atom are not as versatile as I thought, since to me this is a pretty basic feature
I'm assuming it's an underlying limitation of Electron since both are built on that.
@Pete-S said in Looking at Atom and VS Code:
@stacksofplates said in Looking at Atom and VS Code:
As for ctrl+<-/-> just modify the keybindings. Here's an answer for that specific command.
Great thanks. Too bad it's not just a simple setting.
Having the settings in JSON like that is nice because it's easy to back up. There's an extension that syncas all of your extensions and settings to a gist in GitHub.
I still use VSCode a good bit but most of my stuff is done in JetBrains tools now.
Interesting. Not something I've ever even thought of. I pretty much enable vim mode on everything I use so I've never thought to try something like that.
@Pete-S said in Looking at Atom and VS Code:
@stacksofplates said in Looking at Atom and VS Code:
Arrowing up and down stays in place unless there is a break where it can't and then it will jump to that position.
That's the part that I don't want. Almost all code editors has a setting for this.
Can you give an example of one that does? Idk how that's possible if the line above doesn't have an element in that column how it could stay in that column?
As for ctrl+<-/-> just modify the keybindings. Here's an answer for that specific command.
The VSCode settings are all in the settings section. Depending on the extension, some don't have a gui part, so you just modify it in the settings.json file.
As for the line movement, I've never had it jump to the end of the line. Arrowing up and down stays in place unless there is a break where it can't and then it will jump to that position.
On the Python note, I wrote a microservice for a PoC we are doing. I wrote it in Go and it takes a JWT and some information about a secret stored in Vault and authenticates to Vault with the JWT and retrieves the secret. It was around 500-600 lines of code. I rewrote it in Python today and it was less than 40 lines of code.
@JaredBusch said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
@wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
the plan is to remake it in python later. after I convert some stuff and feel comfortable, I'll only use python
I personally hate python because of the space indentation defining code blocks. even if I always space indent my code.
But the language is simple and straightforward.
I always hated it for that, but PyCharm and other IDEs make it pretty easy. PyCharm is probably the best. I'm a fan of the JetBrains tools.
@Dashrender said in At Least 30,000 U.S. Organizations Newly Hacked Via Holes in Microsoft’s Exchange:
@StorageNinja said in At Least 30,000 U.S. Organizations Newly Hacked Via Holes in Microsoft’s Exchange:
@DustinB3403 said in At Least 30,000 U.S. Organizations Newly Hacked Via Holes in Microsoft’s Exchange:
At a prior position they went full tilt "O365/SSO everything" and while it all worked with a LOT of effort the monthly cost was insane per user, something like $42/U/Month for just our 1 location of 160 people.
Globally they had over 9000, that's a huge burden.Except it's not.
- It's opex not capex, so it's not dragging down RIOC ratio's for wall street. (big in Mfg and some industries).
- It's just dumped into the fully burdened cost of an employee. If your average employee is paid 50K they probably cost another 20K in benefits, training, taxes, office space, utilities and other overhead a year. Paying $42 a user per month at that scale gets you out of:
- "owning" versions of Office Suite is great until you end up with 4 different versions of office in the office. Then it becomes a nightmare
- Managing Exchange and Sharepoint etc at scale is a full-time job. paying someone else to manage it wins vs. hiring people to do that.
- Again it's $42 per user per month. We were spending more than that per employee on drinks and snacks before COVID hit. stocking 14 flavors of le croix, and the thousands of pounds of M&M's and "the good nuts" adds up. For a company with 9000 users, something that people are spending hours a day in, that's just cheap.
All that easily makes sense - at that scale.
I know I don't live in anywhere near that scale, and I don't believe Dustin does either.
2/3's of our employees get paid $20K/y.
It can, and likely does still make sense to do it, spend the $42/u/m, but as is contantly talked about on these forums... most small businesses play at business, they don't really run one.
At $20k a year the business is paying somewhere near $2500 a month to employ that person. $42 is nothing out of that.
@wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
@stacksofplates said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
Rather than mess with multiple arrays, you can just have a single dictionary that holds the file and status. A single function can decrypt the file. Then just save the file name and status of the decryption in that dictionary. Then loop through the dictionary and here I just print the data, but you could email it or send to Slack or whatever.
This was a quick pass so probably can be cleaned up a bit.
My reasoning behind two arrays was to keep it organized. If I do all successes in one and then all failures in the other. So I have this now:
#!/usr/bin/env bash source "/home/user1/subdirectory1/master.sh" decryptedFolderPath="/home/user2/subdirectory2/" archiveFolderPath="/home/user1/subdirectory1/archive/in/" extension=${fileName##*\.} newFileName=${fileName%.*} fileWithoutTimestamp="$newFileName.$extension" encryptedItems=$(ls encryptedFolderPath*.pgp) statusArray=() for i in $encryptedItems do gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes --decrypt "$i" | grep -q "encrypted" > "$decryptedFolderPath"/"$fileWithoutTimestamp" outPut=$(gpg --batch --homedir /home/user1/.gnupg/ --passphrase "$PASS" --list-only --list-packets --yes "$i" | grep -q "encrypted") if [ $? != 0 ]; then echo "$i is not a pgp file" statusArray+=("failed to decrypt $i, with status code $? output from pgp: $outPut") fi if [ $? == 0 ]; then statusArray+=("Succesfully Decrypted $i") echo ${#statusArray[@]} | mail -s 'report' [email protected] v=${i%.*} encryptedFile="$v" fileName=${encryptedFile##*/} @@ -27,4 +34,4 @@ continue fi done mv "$i" "$archiveFolderPath"
I think this is what you meant, right?
Well no. I meant Python can easily work with dictionaries (hash maps) vs doing multiple arrays. You'd have to switch to a hash map in Bash vs the multiple arrays.
@wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
@stacksofplates Thanks for your help
No prob. I'm not a bash expert (and I find it annoying lol) so once things get past a certain point I give up with it.
Rather than mess with multiple arrays, you can just have a single dictionary that holds the file and status. A single function can decrypt the file. Then just save the file name and status of the decryption in that dictionary. Then loop through the dictionary and here I just print the data, but you could email it or send to Slack or whatever.
This was a quick pass so probably can be cleaned up a bit.
Here's a quick setup in Python if you want to try it instead.
import os
import gnupg
encrypted_dir = "/tmp/encrypted_files"
archive = "/tmp/archive"
password = os.getenv(os.getenv("DECRYPT_PASSWORD"))
gpg = gnupg.GPG(gnupghome='/home/user/.gnupg')
responses = {}
def decrypt_file(file: str, password: str):
out_name = f'{encrypted_dir}/{file}.decrypted'
stream = open(f'{encrypted_dir}/{file}', "rb")
return gpg.decrypt_file(stream, passphrase=password, output=out_name)
for file in os.listdir(encrypted_dir):
if file.endswith(".gpg"):
stat = decrypt_file(file, password)
responses[file] = stat
else:
continue
for file in responses:
status = responses[file]
if status.ok:
os.rename(f'{encrypted_dir}/{file}', f'{archive}/{file}')
print(f'File {file} decrypted and moved')
else:
print(f'File {file} had error, {status.stderr}')
@wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
@stacksofplates said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
@wirestyle22 said in Return Values in Bash Script and generate e-mail which shows successes, errors and if the directory is empty:
I am breaking this down very slowly for myself. Not a bash master by any measure, but I do want to continue learning it. Arrays seems somewhat annoying in Bash. I will likely learn python to deal with more complex stuff I may need to do with them.
I was going to suggest that. This would likely be easier in Python and more straightforward. If you have to stick to bash, don't declare your arrays in a looplike that, just declare them in the variables at the top
Alright I did that. Is there something better than ShellCheck for bash syntax checking that you know of? Do you just use bash -n script
I don't know of anything better.