ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. Romo
    3. Posts
    • Profile
    • Following 3
    • Followers 2
    • Topics 54
    • Posts 875
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Python Print() Syntax

      EVENTUALLY
      if you really want a comma separated list of items into a string you must format it:

       print("%s; %s" % t)
      

      in this case I've used a semicolon to point out the difference.

      Just to add a little bit to the formatting of strings.

      If you are using python 3.6+ you can use formatted string literals or f-strings which in my opinion are much easier to read and use, rather than formatting with % or .format() or concatenating strings.

      print(f'{name},{dob}')
      romo,1986
      
      posted in IT Discussion
      RomoR
      Romo
    • RE: Python Print() Syntax

      Python's 3 print() is a function . Your variables are the parameters for the print function.

      print(parameter1,parameter2)
      

      Python's 2 print is a special statement not a function so when when you put your variable names inside the print statement python prints out your variables as a tuple because of the , .

      >>>print (name)
      romo
      
      >>> print(name,)
      ('romo',)
      
      
      posted in IT Discussion
      RomoR
      Romo
    • RE: Syncing Google and Ical

      @minion-queen said in Syncing Google and Ical:

      @kelly said in Syncing Google and Ical:

      @minion-queen said in Syncing Google and Ical:

      @kelly said in Syncing Google and Ical:

      When you say that it isn't working, what does that mean? Are you getting an error? I just ran into this the other day, and the calendar was syncing using the common instructions, but it wasn't automatically displaying, nor was it listed as an option in gmail. I had to go into the calendar settings and turn on ical calendar. I'll see if I can't get better steps here in a minute.

      No error or anything just nothing happening at all.

      Thank you!

      Just to be clear, you're trying to get her calendar out of gmail calendar and into another iCal based calendar, or the other way around?

      Both directions actually. Out of Gmail into Ical is working fine. But if she schedules something in Ical it is not blocking off time in Gmail.

      Maybe make the ICAL calendar public and then import the webcal link into google calendar?

      posted in IT Discussion
      RomoR
      Romo
    • RE: Learn to Code Python with Thonny

      @scottalanmiller It really looks great, I normally copied my code to http://www.pythontutor.com/ to step through it but it only works for small to mid stuff.

      @Tim_G this would really help out with learning Python

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Prevent users on local workstations from changing the time

      @ccwtech said in Prevent users on local workstations from changing the time:

      @dbeato Yes, but they move the clock back 10 minutes, clock in, and then they move it back to the real time.

      The backend should be the one setting the time when saving to the db. Why accept the time from the clients if it could easily be modified like this.

      posted in IT Discussion
      RomoR
      Romo
    • RE: Dipping Toes Into Programming

      @tim_g said in Dipping Toes Into Programming:

      I found this website which looks interesting and helpful:

      https://automatetheboringstuff.com/

      That is great as well, I would totally recommend it.

      Udacity also has several really good Python courses which I will also recommend you to check out.

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Dipping Toes Into Programming

      @scottalanmiller said in Dipping Toes Into Programming:

      @tim_g said in Dipping Toes Into Programming:

      @romo said in Dipping Toes Into Programming:

      @tim_g said in Dipping Toes Into Programming:

      @scottalanmiller said in Dipping Toes Into Programming:

      @tim_g said in Dipping Toes Into Programming:

      @flaxking said in Dipping Toes Into Programming:

      @tim_g

      Flask is an unassuming simple framework. It is good for creating something simple, or for creating something complex and cutting edge where you need flexibility. In order to build out a webapp, you would need to learn more components than just Flask.

      Django is a monolithic framework, batteries are included. You just have to learn Django in order to build a web app. You don't have to create things from scratch, but there are certain ways to do things, so there is less flexibility. It takes longer to learn Django, because there is so much more there. But when you do learn it, you can pump out web apps pretty fast. With Flask there are other things you have to learn, and you have to figure out how you want them to interact.

      Once you have a decent amount of Python, you can learn at least the basics of Flask in a day, and then look at learning Django too.

      If you're interested in messing around with Salt, I think Python is the way to go. Salt's code is pretty easy to understand and work with for junior devs, and you can start making your own customizations.

      Thanks for the explanation, it helps a lot.

      This narrows it down to the following:

      • Python / Django
      • JavaScript / ReactJS

      ReactJS is just an interface layer, it's not a framework like Django.

      Yes I'm not as worried about having a full framework like Django for JavaScirpt. ReactJS seems to hit all the check boxes I'm looking for though.

      I wouldn't even start touching ReactJS until I would be well into JavaScript anyways. And at that point, it may be that I change my mind and want something else once I understand everything much better.

      With Django, I would start both at the same time, as my focus would purely be on the web side first, I think.

      I will recommend you read more about server-side rendering and client-side rendering to really decide what are you going to use when building your apps/web pages. There is really nothing to compare between Django and ReactJS, they can even work together since one can be used as backend and the other as the frontend.

      Django is batteries included framework which by default is used to render web templates server side; It can just as easily be used with the Django-Rest-Framework to create Rest APIs and be consumes by your client-side javascript libraries/frameworks.

      ReactJS is a library mainly used for client-side rendering and building SPAs, you can use is to render server side using something like Nextjs but that is not its most common usage.

      Yes I get they can all be used together, but I need to start somewhere. I don't know any Python or JavaScript. I need to start there. I feel Python is the best place to start, at least until a more general understanding of it, then get into Django with Python.

      Probably starting on "non-web" is good. Learning web first is very confusing.

      I agree, first learn the basics of the languages and then start with the web stuff.

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Dipping Toes Into Programming

      @tim_g said in Dipping Toes Into Programming:

      @scottalanmiller said in Dipping Toes Into Programming:

      Have you written HTML by hand? If not, you should. It helps to make this more clear.

      Yes i've written full plain HTML websites from scratch, I'm well versed in it, though it's been a while. I get HTML, that's easy.

      That bit of HTML I gave before as an example, if you remove the javascript, you just see a blank page.

      Now, with your explanations from above, it yet makes things even more clear.

      So let's see if I have this right:

      Above HTML displays a blank page, but one (combined with the others) of the pieces (i'm assuming molten.js) loads via the <script> tag. This I'm familiar with too, back in the day I used already made javascripts on my sites to do cool things on pages.

      So what you're saying is that molten.js is doing all the behind the scenes work on the server, and then outputting it's own HTML (what you see when the webpage loads), on top of that blank HTML page going on in index.html? I'm thinking of it in the context of acting like an iframe if you know what I'm getting at.

      This is a SPA, which means all the logic, rendering and routing of the app is moved away from the server and into the client(client-side rendering). Molten.js is the app (the whole interface) bundled together (using webpack) and sent to you completely on your first request.

      Even though the backend is using a python framework (cherrypy), you don't have to write any Python code at all to consume the REST API exposed by it. Basically the backend is only sending your browser JSON and nothing else after the first request.

      I'm familiar with that as well then, in a way, as I have a PowerShell script that grabs all users from specified OUs plus some specified info as well as their AD picture, and outputs it to a .html file to be used as a company phone list. But in this case, the PowerShell script is generating the entire index.html file itself. Not being called and loading content after an existing page is already loaded.

      This is more akin to server-side rendering, where the backend is completely in charge of the logic, the routing and rendering of the HTML templates. When using server-side rendering, each request for a new page you make on the client causes a page refresh which contains a pre-rendered HTML template as a response from the backend.

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Dipping Toes Into Programming

      @tim_g said in Dipping Toes Into Programming:

      @scottalanmiller said in Dipping Toes Into Programming:

      @tim_g said in Dipping Toes Into Programming:

      @flaxking said in Dipping Toes Into Programming:

      @tim_g

      Flask is an unassuming simple framework. It is good for creating something simple, or for creating something complex and cutting edge where you need flexibility. In order to build out a webapp, you would need to learn more components than just Flask.

      Django is a monolithic framework, batteries are included. You just have to learn Django in order to build a web app. You don't have to create things from scratch, but there are certain ways to do things, so there is less flexibility. It takes longer to learn Django, because there is so much more there. But when you do learn it, you can pump out web apps pretty fast. With Flask there are other things you have to learn, and you have to figure out how you want them to interact.

      Once you have a decent amount of Python, you can learn at least the basics of Flask in a day, and then look at learning Django too.

      If you're interested in messing around with Salt, I think Python is the way to go. Salt's code is pretty easy to understand and work with for junior devs, and you can start making your own customizations.

      Thanks for the explanation, it helps a lot.

      This narrows it down to the following:

      • Python / Django
      • JavaScript / ReactJS

      ReactJS is just an interface layer, it's not a framework like Django.

      Yes I'm not as worried about having a full framework like Django for JavaScirpt. ReactJS seems to hit all the check boxes I'm looking for though.

      I wouldn't even start touching ReactJS until I would be well into JavaScript anyways. And at that point, it may be that I change my mind and want something else once I understand everything much better.

      With Django, I would start both at the same time, as my focus would purely be on the web side first, I think.

      I will recommend you read more about server-side rendering and client-side rendering to really decide what are you going to use when building your apps/web pages. There is really nothing to compare between Django and ReactJS, they can even work together since one can be used as backend and the other as the frontend.

      Django is batteries included framework which by default is used to render web templates server side; It can just as easily be used with the Django-Rest-Framework to create Rest APIs and be consumes by your client-side javascript libraries/frameworks.

      ReactJS is a library mainly used for client-side rendering and building SPAs, you can use is to render server side using something like Nextjs but that is not its most common usage.

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Dipping Toes Into Programming

      @Tim_G I am currently learning web development as well so we can help each other on this new path.

      I would totally recommend two resources to start Mozilla MDN web developer guide and Freecodecamp. Freecode camp being completely interactive and the Mozilla docs being mainly reading guides but both are quite good and as a plus for the Mozilla guide is that they include a Django tutorial as part of the server side tutorial.

      Freecodecamp mainly focuses on teaching you Javascript so if you would like to use a python backend framework you should also take a python course. But if you don't mind its javascript focus it is pretty complete. It will freshen up your html and css, teach you javascript for the front end (currently vanilla javascript and jquery but the beta curriculum adds react as well ), https://d3js.org/ for data visualization and node/expressjs for the backend

      This is their current front end path, they teach you the basics and then make you build stuff to really put to practice what you learn.
      alt text

      My end goal is to be able to intelligently write bits of software that are able to communicate and interact with APIs like REST API, to display and manipulate data on HTML5 pages.

      If you only want to consume and interact with already made REST APIs you should focus and start on the frontend stuff. This will lead you straight to javascript first which is what you will use to interact with them from the browser.

      I would advise you to first learn vanilla javascript (focusing on ES6+ if you can) and then think about learning and using libraries like reactjs or vuejs.

      posted in Developer Discussion
      RomoR
      Romo
    • RE: Can some one explain CPU shares|Weight-sum|weight

      It is not really needed to tinker with CPU priorities unless you really, really know what you are doing.

      Setting CPU scheduling and priorities on docker containers is just like doing it on any other Linux process it is just tinkering with CFS scheduler which is the Linux Kernel default scheduler.

      So basically, do you set CPU schedules, limits and priorites for any other linux process? Most probably the answer will be no because you let the kernel and its default scheduler handle things without worrying about them. But if you know what you are doing and need those kinds of kernel feature go ahead and tinker with them.

      We just always need to remember, Docker container are not VMS

      Edit:
      Right from the docker documentation:
      alt text

      posted in IT Discussion
      RomoR
      Romo
    • RE: SodiumSuite sign up temporarily frozen?

      The register now button in the hero image is redirecting properly to https://sodium.waxquixotic.com/companyCreation, so new accounts can indeed register.
      alt text

      posted in IT Discussion
      RomoR
      Romo
    • RE: NAS alternative on the cheap

      @emad-r No issues booting from Raid 1, system has been live for 4 years.
      No it is not using UEFI.

      posted in IT Discussion
      RomoR
      Romo
    • RE: NAS alternative on the cheap

      I have mine setup like this:

      cat /proc/mdstat
      Personalities : [raid10] [raid1] 
      md0 : active raid1 sda1[0] sdb1[1] sdd1[3] sdc1[2]
            409536 blocks super 1.0 [4/4] [UUUU]
            
      md2 : active raid10 sdd3[3] sdc3[2] sda3[0] sdb3[1]
            965448704 blocks super 1.1 512K chunks 2 near-copies [4/4] [UUUU]
            bitmap: 4/8 pages [16KB], 65536KB chunk
      
      md1 : active raid10 sdd2[3] sdc2[2] sda2[0] sdb2[1]
            10230784 blocks super 1.1 512K chunks 2 near-copies [4/4] [UUUU]
      
      $ df -Th
      Filesystem           Type   Size  Used Avail Use% Mounted on
      /dev/mapper/vg_mc-ROOT
                           ext4    25G  1,7G   22G   7% /
      tmpfs                tmpfs  3,9G     0  3,9G   0% /dev/shm
      /dev/md0             ext4   380M  125M  235M  35% /boot
      /dev/mapper/vg_mc-DATA
                          
      
      

      Boot Raid 1
      Swap Raid 10
      Everything else raid 10 and then LVM on top

      posted in IT Discussion
      RomoR
      Romo
    • RE: bat script for uploading file to ftp

      @smartkid808 Sorry my bad, run the bat from either powershell or cmd and pass the parameter /I for a single File or /L for a list of files written on a file one per line.

      UploadToFTP.bat /I thisIsMyFile.txt
      
      UploadToFTP.bat /L fileContainingListOfFilesInside.txt
      
      posted in IT Discussion
      RomoR
      Romo
    • RE: bat script for uploading file to ftp

      @smartkid808 Edit the fields bellow Connection information:

      @ECHO OFF
      ECHO Upload to FTP
      ECHO Written by: Jason Faulkner
      ECHO SysadminGeek.com
      ECHO.
      ECHO.
      
      REM Usage:
      REM UploadToFTP [/L] FileToUpload
      REM
      REM Required Parameters:
      REM  FileToUpload
      REM      The file or file containing the list of files to be uploaded.
      REM
      REM Optional Parameters:
      REM  /L  When supplied, the FileToUpload is read as a list of files to be uploaded.
      REM      A list of files should be a plain text file which has a single file on each line.
      REM      Files listed in this file must specify the full path and be quoted where appropriate.
      
      SETLOCAL EnableExtensions
      
      REM *** Connection information: EDIT THE FOLLOWING FIELDS*****
      SET Server=
      SET UserName=
      SET Password=
      
      REM***********************************************************
      
      REM ---- Do not modify anything below this line ----
      
      SET Commands="%TEMP%SendToFTP_commands.txt"
      
      REM FTP user name and password. No spaces after either.
      ECHO %UserName%> %Commands%
      ECHO %Password%>> %Commands%
      
      REM FTP transfer settings.
      ECHO binary >> %Commands%
      
      IF /I {%1}=={/L} (
         REM Add file(s) to the list to be FTP'ed.
         FOR /F "usebackq tokens=*" %%I IN ("%~dpnx2") DO ECHO put %%I >> %Commands%
      ) ELSE (
         ECHO put "%~dpnx1" >> %Commands%
      )
      
      REM Close the FTP connection.
      ECHO close  >> %Commands%
      ECHO bye    >> %Commands%
      
      REM Perform the FTP.
      FTP -d -i -s:%Commands% %Server%
      
      ECHO.
      ECHO.
      
      REM Clean up.
      IF EXIST %Commands% DEL %Commands%
      
      ENDLOCAL
      
      

      Server – The FTP Server you are uploading to. You can either enter the DNS name (ftp.myserver.com) or IP address (1.2.3.4).
      UserName – Your user name for connecting to FTP server.
      Password – Your password for connecting to the FTP server.

      posted in IT Discussion
      RomoR
      Romo
    • RE: What Are You Doing Right Now

      @thwr said in What Are You Doing Right Now:

      Wow, easy guys. It's still me. I've not been around here for a couple of months (for a very good reason), but you all know me well enough.

      a) I've applied for the budget in the first hand. It's NOT a yearly budget. It's a special one-time project budget.

      b) I could have asked for way more and go for Cisco or whatever. But I choosed UBNT? Why? Because they are awesome and very affordable, as we all know. Using other well known vendors would have driven the costs... What? 5 times up? 10 times? Even more?

      c) no secret: I'm still no - and will never be - a native English speaker. Keep that in mind, it's not always easy to explain things especially in topics such as business finances. I guess you got something wrong here.

      So, please, think a second before using a words like "corruption" or bad ethic habits.

      Nothing really against you @thwr it was really a complaint on my part of the system and how financial departments handle public money than a comment against you.

      :smiling_face_with_open_mouth_smiling_eyes:

      posted in Water Closet
      RomoR
      Romo
    • RE: What Are You Doing Right Now

      @scottalanmiller said in What Are You Doing Right Now:

      @thwr said in What Are You Doing Right Now:

      @dashrender said in What Are You Doing Right Now:

      @thwr said in What Are You Doing Right Now:

      @dashrender said in What Are You Doing Right Now:

      So you're telling me that since I didn't waste money and replace them early, before they needed replacing... that I won't be able to replace them next year if they fail? ridiculous.

      That's reality mate. Not good, not what I like, but it's a real thing.

      Well, we know corruption when we see it, don't we?

      Corruption? No. It's more about how your financial department runs your business. We're in fact controlled by two other gov agencies to avoid anything unnecessary or unjustified.

      Actually, it's the opposite. They are pushing you to waste money.

      It is a complete waste of resources in my opinion as well. I work for public edu as well so I have the same dumb budget management that @thwr has.

      I really don't understand why public money must be handled that way and why people think it is the best way to show transparency for money usage.

      • Budget created and asked for accountants without IT input
      • Budget created usually between Oct - Dec of the previous year.
      • Budget must last the whole year and must be completely used or risk getting a smaller amount next year.
      • Because the budget must last the whole year, most buys are rushed on the last months in order to utilize the whole budget not really taking into account real business requirements. Must of the stuff is never actually used by IT.

      This would never be allowed on private companies, why is is allowed on public ones, at least for my country I must agree with @Dashrender CORRUPTION no other way to call it in my book.

      posted in Water Closet
      RomoR
      Romo
    • RE: How can I sed or regex this out

      @jaredbusch said in How can I sed or regex this out:

      @romo said in How can I sed or regex this out:

      @jaredbusch said in How can I sed or regex this out:

      ****** Object: UserDefinedFunction [dbo].[FiscalMo] Script Date: 11/30/2017 10:24:23 AM ******

      sed 's/Script.*M //g'
      

      I need at least one * and the / to close.

      So this?

      sed 's/Script.*M /\ \*\//g'
      

      You are escaping seds delimiters with that.

      Changing the delimiters for better clarity:

      sed 's|Script.*M ||g' 
      

      From Script to M + space, replace with space,. It keeps all your * and the final /.

      0_1512131437191_Screenshot_20171201-062914.png

      posted in IT Discussion
      RomoR
      Romo
    • RE: How can I sed or regex this out

      @jaredbusch said in How can I sed or regex this out:

      ****** Object: UserDefinedFunction [dbo].[FiscalMo] Script Date: 11/30/2017 10:24:23 AM ******

      sed 's/Script.*M //g'
      
      posted in IT Discussion
      RomoR
      Romo
    • 1
    • 2
    • 14
    • 15
    • 16
    • 17
    • 18
    • 43
    • 44
    • 16 / 44