Skip to content

Instantly share code, notes, and snippets.

@saviour123
Last active April 8, 2021 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saviour123/e919302d9b0edf4a7a32 to your computer and use it in GitHub Desktop.
Save saviour123/e919302d9b0edf4a7a32 to your computer and use it in GitHub Desktop.
DB_Scripts
### MONGO
db.createUser({user: "mongo-admin", pwd: "password", roles:[{role: "root", db: "admin"}]})
mongo -u dsals -p --authenticationDatabase dbname
### Create MYSWL User and grant the user ready only.
create user 'username'@'%' identified by ‘password‘;
grant select, show view on database_name.* to 'username'@'%' identified by 'password';
### SQLSERVER
update AspNetUsers set IsDeleted=1 where email='superadmin@noodle.com'
update AspNetUsers set IsGoogleUser=1 where email='superadmin@noodle.com'
-- ALTER ROLE db_datareader add member jjanicelli;
-- CREATE LOGIN [jjanicelli] WITH PASSWORD = 'tr3s0n3tact1e';
-- CREATE USER jjanicelli FROM LOGIN jjanicelli;
-- ALTER ROLE developers ADD MEMBER jjanicelli;
-- ALTER ROLE db_datawriter add member jjanicelli;
-- ALTER ROLE developers ADD MEMBER rganeshan;
-- ALTER ROLE db_datawriter add member rganeshan;
## use pgfutter to pump csv into postgres while creating tables in destination tables
for f in *;
do
if [[ $f = 'load.sh' ]]
then
echo "skipped $f"
fi
table_name=$(echo "$f" | cut -f 1 -d '.')
~/pgfutter_darwin_amd64 --db "ponde" --host "host_url" --port "5432" --user "root" --schema "public" --table $table_name --pw "<beautiful_password>" csv $f
echo $f
done
@jeffgodwyll
Copy link

to find out the contents of your form if you don't understand what's going on behind the scene, you can try something like

f = request.form
for key in f.keys():
    for value in f.getlist(key):
        print key,":",value

Also by the way the name of your button is button not SUBMIT, look at it again https://gist.github.com/saviour123/e919302d9b0edf4a7a32#file-mysimpleform-L23 and https://gist.github.com/saviour123/e919302d9b0edf4a7a32#file-mysimpleform-L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment